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 Main (main) where import Control.Concurrent (forkIO, killThread) import Control.Monad.Trans (liftIO) import Happstack.Server.SimpleHTTP import Rest.Driver.Happstack (apiToHandler') import Api (api) import ApiTypes (ServerData (..), runBlogApi) import Example (exampleBlog) -...
tinkerthaler/basic-invoice-rest
happstack/Main.hs
bsd-3-clause
796
0
11
124
197
109
88
18
1
module Main where import Pipes import Pipes.Parse import qualified Pipes.Prelude as P import qualified Pipes.ZMQ3 as PZ import qualified System.ZMQ3 as Z import Control.Concurrent(threadDelay) import Control.Concurrent.Async import Control.Monad (forever, unless) import Control.Applicative((<$>), (<*>)) import qual...
PierreR/pipes-zmq3
sub.hs
bsd-3-clause
2,998
0
17
873
977
512
465
60
1
{-# LANGUAGE OverloadedStrings #-} import Control.Applicative import Control.Monad import Data.List (intercalate) import Data.Monoid (Monoid(..)) import ListUtils (sortOn) import Parser (CostCentre(..), CostCentreData(..), TimeAlloc(..)) import Parser (parser) import System.Environment (getArgs) import TextUtils (showT...
Peaker/HaskProfileGui
Main.hs
bsd-3-clause
1,549
0
22
315
508
282
226
44
2
module Hess.Generate ( generate ) where import Data.List import Hess.Type generateDef :: Definition -> String generateDef (Def sels pseudoclasses properties) = ss ++ pcs ++ " { " ++ props ++ " }" where ss = intercalate ", " $ map show sels props = intercalate "; " $ map show properties pcs = if lengt...
vincenthz/hess
Hess/Generate.hs
bsd-3-clause
493
10
11
110
176
91
85
14
2
{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE MultiParamTypeClasses #-} ----------------------------------------------------------------------------- -- | -- Module : System.Console.Terminal....
lens/terminal
src/System/Console/Terminal/Color.hs
bsd-3-clause
3,731
0
10
935
978
530
448
69
0
module Utils where import qualified Data.Aeson as Aeson import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy.Char8 as BSL import qualified Data.Text.Encoding as TE import Data.Text.Lazy (Text) import qualified Data.Text.Lazy as TL import Web.Scotty.Internal.Types tlToBS :: TL.Text -> ByteString t...
freizl/hoauth2
hoauth2-example/src/Utils.hs
bsd-3-clause
773
0
9
122
270
151
119
21
2
{-# OPTIONS_GHC -Wall #-} module Euler.E096 ( main, isSolved, sumIs45Filter, blah ) where import Control.Monad ( foldM ) import Data.IntSet ( IntSet, (\\) ) import qualified Data.IntSet as IS import Data.List ( transpose ) import Data.Maybe import Data.Vector ( Vector, (!), (//) ) import qualified Data.Vector as V i...
ghorn/euler
Euler/E096.hs
bsd-3-clause
5,139
0
14
1,340
1,688
910
778
-1
-1
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecursiveDo #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} module Reflex.Dom.Widget.Resize where import Reflex.Class import Reflex.Time import Reflex.Dom.Builder.Class import...
mightybyte/reflex-dom
reflex-dom-core/src/Reflex/Dom/Widget/Resize.hs
bsd-3-clause
4,966
0
21
951
1,387
719
668
83
2
module Main where import System.Console.Haskeline import System.IO import System.Environment import System.Exit import System.FilePath ((</>), addTrailingPathSeparator) import Data.Maybe import Data.Version import Control.Monad.Trans.State.Strict ( execStateT, get, put ) import Control.Monad.Trans ( liftIO ) import C...
byorgey/Idris-dev
src/Main.hs
bsd-3-clause
3,554
0
28
1,030
696
360
336
80
3
module Color.Spectrum.Observer where class Num a => ObserverModel m a | m -> a where chromaticResponseWindow :: m -> (a, a) chromaticResponse :: m -> a -> a -> XYZ a
ekmett/colorimetry
Colorimetry/Observer/ChromaticResponseModel.hs
bsd-3-clause
171
0
10
36
66
36
30
-1
-1
{- | Module : $Header$ Copyright : (c) Simon Bergot License : BSD3 Maintainer : simon.bergot@gmail.com Stability : unstable Portability : portable Subparsers allows the creation of complex command line applications organized around commands. -} module System.Console.ArgParser.SubPars...
sbergot/ArgParser
src/System/Console/ArgParser/SubParser.hs
bsd-3-clause
2,965
0
15
725
726
390
336
53
2
{-# LANGUAGE InstanceSigs #-} module PFDS.Commons.HoodMelvilleQueue where import qualified PFDS.Commons.Queue as Q data RotationState a = Idle | Reversing Int [a] [a] [a] [a] | Appending Int [a] [a] | Done [a] data Queue a = Q Int [a] (RotationState a) Int [a] exec :: RotationState a -> Rot...
matonix/pfds
src/PFDS/Commons/HoodMelvilleQueue.hs
bsd-3-clause
1,703
0
10
445
934
479
455
42
2
module Resolve.DNS.Helper.DNS where import Network.Socket import Resolve.Types import Resolve.DNS.Types import qualified Resolve.DNS.Helper.UDP as UDP import qualified Resolve.DNS.Helper.LiveTCP as TCP import qualified Resolve.DNS.Truncation as T import Control.Exception data Config = Config { host :: HostName ...
riaqn/resolve
src/Resolve/DNS/Transport/Helper/DNS.hs
bsd-3-clause
903
0
17
318
274
154
120
22
1
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RankNT...
glebovitz/demo
src/DataAnalysis/Library.hs
mit
4,443
0
22
1,248
757
428
329
74
2
-- -- | Configuration for generating X509 certificates -- -- Users are expected to provide configuration (from file or by hand) and use -- 'fromConfiguration' to turn them into description. -- Then, full description can be turned into certificates via 'genCertificate' -- -- Configuration --fromConfiguration--> Descript...
input-output-hk/pos-haskell-prototype
x509/src/Cardano/X509/Configuration.hs
mit
12,841
53
20
3,495
2,524
1,466
1,058
-1
-1
module SafeHello where import MonadHandle import System.IO (IOMode(..)) {-- snippet safeHello --} safeHello :: MonadHandle h m => FilePath -> m () safeHello path = do h <- openFile path WriteMode hPutStrLn h "hello world" hClose h {-- /snippet safeHello --}
binesiyu/ifl
examples/ch15/SafeHello.hs
mit
266
0
8
49
80
41
39
8
1
{- | Module : $Header$ Description : A module for working with series Copyright : (c) Nicholas Orton License : GPL Maintainer : no | <nick@orton.biz> Stability : provisional Portability : portable Code : https://github.com/nick-orton/project_euler/blob/master/Lib/Numz.lhs -} module Euler.Numz wh...
nick-orton/euler
src/Euler/Numz.hs
gpl-3.0
2,344
0
13
532
648
374
274
29
1
{-| Module : Expr Description : Expressions Copyright : (c) Daniel Selsam, 2016 License : GPL-3 Maintainer : daniel.selsam@gmail.com API for expressions -} module Kernel.Expr ( Expr(..) , LocalData(LocalData), VarData, SortData, ConstantData(ConstantData), BindingData, AppData, LetData , BinderInfo(....
dselsam/tc
src/Kernel/Expr.hs
gpl-3.0
1,064
0
5
166
217
146
71
26
0
module Analysis.CriticalPairs ( CriticalPairType (..) , CriticalPair (..) , getCriticalPairMatches , getCriticalPairComatches , getNacIndexOfCriticalPair , getNacMatchOfCriticalPair , getCriticalPairType , isDeleteUse , isProduceDangling , isProduceForbid -- * Finding Critical Pairs , findCrit...
rodrigo-machado/verigraph
src/library/Analysis/CriticalPairs.hs
gpl-3.0
7,471
0
13
1,548
1,345
733
612
91
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/DeleteLayer.hs
mpl-2.0
3,323
0
9
693
361
222
139
48
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-datapipeline/gen/Network/AWS/DataPipeline/AddTags.hs
mpl-2.0
2,957
0
10
718
421
255
166
54
1
{-# LANGUAGE OverloadedStrings #-} module HollaBack.Testing.Date.Parser (specs) where import Data.Attoparsec.Text (parseOnly, maybeResult, eitherResult, Parser) import Data.Maybe (fromJust) import Data.Text (Text) import Test.Hspec ...
MichaelXavier/HollaBack
HollaBack/Testing/Date/Parser.hs
bsd-2-clause
6,041
0
12
1,514
409
288
121
33
1
-- | -- Module : Crypto.PubKey.ECIES -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- IES with Elliptic curve <https://en.wikipedia.org/wiki/Integrated_Encryption_Scheme> -- -- This is a simple cryptographic system between ...
tekul/cryptonite
Crypto/PubKey/ECIES.hs
bsd-3-clause
2,173
0
12
484
235
136
99
20
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Typechecking class declarations -} {-# LANGUAGE CPP #-} module TcClassDcl ( tcClassSigs, tcClassDecl2, findMethodBind, instantiateMethod, tcClassMinimalDef, HsS...
mcschroeder/ghc
compiler/typecheck/TcClassDcl.hs
bsd-3-clause
19,449
0
19
6,303
3,354
1,755
1,599
252
2
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} -- | This module provides facilities for patching incoming 'Requests' to -- correct the value of 'rqClientAddr' if the snap server is running behind a -- proxy. -- -- Example usage: -- -- @ -- m :: Snap () -- m = undefined -- code goes here -- -- a...
snapframework/snap-core
src/Snap/Util/Proxy.hs
bsd-3-clause
3,207
0
14
713
430
263
167
29
1
{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Get -- Copyright : (c) Andrea Vezzosi 2008 -- Duncan Coutts 2011 -- John Millikin 2012 -- License : BSD-like -- -- Maintainer : ca...
gbaz/cabal
cabal-install/Distribution/Client/Get.hs
bsd-3-clause
12,820
0
22
3,419
2,989
1,529
1,460
253
6
{-# LANGUAGE ViewPatterns #-} {- The spirit of guarded recursion is that we can only re-enter the recursion with a smaller value. Can we enforce this with view patterns and a type system that tracks effective refinement types? -} import Control.Arrow data Nat = Z | S Nat deriving Show five = S (S (S (S (S ...
minad/omega
mosaic/GuardedFib.hs
bsd-3-clause
1,552
0
13
435
347
189
158
19
1
module Data.JSTarget.Op where import Prelude hiding (GT, LT) data BinOp = Add | Mul | Sub | Div | Mod | And | Or | Eq | Neq | LT | GT | LTE | GTE | Shl | ShrL | ShrA | BitAnd | BitOr | BitXor deriving (Eq) instance Show BinOp where show Add = "+" show Mul = "*" sh...
joelburget/haste-compiler
src/Data/JSTarget/Op.hs
bsd-3-clause
1,418
0
6
480
484
258
226
72
1
<?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="sl-SI"> <title>Regular Expression Tester</title> <maps> <homeID>regextester</homeID> <m...
thc202/zap-extensions
addOns/regextester/src/main/javahelp/help_sl_SI/helpset_sl_SI.hs
apache-2.0
978
77
66
157
409
207
202
-1
-1
<?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="id-ID"> <title>Mulai Cepat | Ekstensi ZAP</title> <maps> <homeID>top</homeID> <mapref l...
thc202/zap-extensions
addOns/diff/src/main/javahelp/org/zaproxy/zap/extension/diff/resources/help_id_ID/helpset_id_ID.hs
apache-2.0
971
78
66
159
413
209
204
-1
-1
module Expr1 where import Control.Parallel.Strategies fib n | n <= 1 = 1 | otherwise = n1_2 + n2_2 + 1 where n1 = fib (n-1) n2 = fib (n-2) (n1_2, n2_2) = runEval (do n1_2 <- rpar n1 n2_2 <- rpar n2 ...
RefactoringTools/HaRe
old/testing/introThreshold/Expr1.hs
bsd-3-clause
365
0
12
182
135
68
67
14
1
{- - Instant Insanity using Closed Type Families, but no DataKinds - - See: http://stackoverflow.com/questions/26538595 -} {-# OPTIONS_GHC -ftype-function-depth=400 #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} import Prelude hiding (all, flip, ma...
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/perf/compiler/T9872c.hs
bsd-3-clause
3,681
0
20
1,097
1,491
807
684
-1
-1
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE TypeOperators #-} module T8357 where import Data.Kind (Type) import GHC.TypeLits data (:::) (sy :: Symbol) ty data Key (sy :: Symbol) data Rec (rs :: [Type]) (*...
sdiehl/ghc
testsuite/tests/ghci/scripts/T8357.hs
bsd-3-clause
734
0
10
159
287
170
117
-1
-1
{-# LANGUAGE CPP #-} -- | Hard wired things related to registers. -- This is module is preventing the native code generator being able to -- emit code for non-host architectures. -- -- TODO: Do a better job of the overloading, and eliminate this module. -- We'd probably do better with a Register typ...
acowley/ghc
compiler/nativeGen/TargetReg.hs
bsd-3-clause
5,044
0
9
1,168
867
428
439
98
12
{-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | -- Module : Tests.Util -- Copyright : (C) 2015 Richard Eisenberg -- License : BSD-style (see LICENSE) -- Maintainer : Richard Eisenberg (eir@cis.upen...
ajnsit/glambda
tests/Tests/Util.hs
bsd-3-clause
1,779
0
18
405
517
283
234
30
1
{-# LANGUAGE QuasiQuotes, TypeFamilies, TemplateHaskell, MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE FlexibleInstances, ViewPatterns #-} {-# LANGUAGE CPP #-} module YesodCoreTest.CleanPath (cleanPathTest, Widget) where import Test.Hspec import Yesod.Core import Network.Wai import Networ...
ygale/yesod
yesod-core/test/YesodCoreTest/CleanPath.hs
mit
4,902
0
16
1,188
1,330
681
649
120
1
module UntypedLambda.Compiler ( toIota ) where import Prelude hiding (id) import UntypedLambda.Syntax import qualified Iota.Syntax as I toIota :: Term -> I.Module toIota = I.Defs . topLevel topLevel :: Term -> [I.FunDef] topLevel (Const n) = [I.FunDef "main" [] (I.Const n)] topLevel t@(App _ _) = defs ("main":na...
mmakowski/ambc
src/UntypedLambda/Compiler.hs
mit
857
0
9
173
395
213
182
23
1
{-# LANGUAGE FlexibleContexts, DeriveDataTypeable, DeriveFunctor, TypeFamilies #-} module Wf.Control.Eff.Authenticate ( Authenticate(..) , AuthenticationType(..) , authenticate , authenticationTransfer ) where import Control.Eff (Eff, Member, send, inj) import Data.Typeable (Typeable) import Wf.Network.Http.Response (...
bigsleep/Wf
wf-authenticate/src/Wf/Control/Eff/Authenticate.hs
mit
1,107
0
11
183
324
178
146
22
1
-- -- HUnit tests for the parser -- -- Create an executable -- > ghc -o runparsertests testaspparse.hs aspparse.hs -- > ./runparsertests -- -- Or in the interpreter: -- ghci> :l testaspparse.hs -- ghci> runTestTT tests -- -- -- Copyright 2012,2013 Vesa Luukkala -- -- Permission is hereby granted, free of charge...
vluukkal/aspreify
testaspparse.hs
mit
54,828
14
20
9,092
20,890
10,599
10,291
269
2
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-} module GHCJS.DOM.JSFFI.Generated.Worker (js_newWorker, newWorker, js_postMessage, postMessage, js_terminate, terminate, message, Worker, castToWorker, gTypeWorker) where import Prelude ((.), (==), (>>=), return, IO, ...
plow-technologies/ghcjs-dom
src/GHCJS/DOM/JSFFI/Generated/Worker.hs
mit
2,629
22
11
412
636
372
264
45
1
module PE0014 where import Data.List (maximumBy) import Data.Ord (comparing) collatzStep :: Integral a => a -> a collatzStep n | even n = n `div` 2 collatzStep n | otherwise = 3 * n + 1 -- | -- >>> collatzChain 3 -- [3,10,5,16,8,4,2,1] collatzChain :: Integral a => a -> [a] collatzChain 1 = [1] collatzChain n | n...
mvidner/projecteuler
src/PE0014.hs
mit
668
0
11
140
256
135
121
15
1
{-# LANGUAGE RecordWildCards #-} module Main where import qualified Graphics.Vty as V import qualified Brick.AttrMap as A import qualified Brick.Main as M import Brick.Types (Widget) import qualified Brick.Types as T import Brick....
zsedem/gitcommander
Main.hs
mit
2,916
0
13
897
751
418
333
58
2
module BibleRot where import Rotations import Data.List import Control.Monad.Random {- This is an example of using rotations to modify text based off of the king james version of the bible from Gutenberg The first thing we need to do is run through the text in order to figure out where our chapter and paragra...
clarissalittler/nanogenmo-2015
BibleRot.hs
mit
2,852
0
13
717
878
467
411
42
2
{-# LANGUAGE OverloadedStrings #-} module Y2021.M01.D21.Exercise where import Y2021.M01.D20.Solution -- for wineries import Data.Aeson.WikiDatum (Name) import Graph.Query import Graph.JSON.Cypher import qualified Graph.JSON.Cypher.Read.Rows as RR {-- Okay, yesterday, we got some lat/longs, or, more precisely, s...
geophf/1HaskellADay
exercises/HAD/Y2021/M01/D21/Exercise.hs
mit
1,681
0
7
266
144
91
53
17
1
module Day5 where import Data.List (group, isInfixOf) rule1 :: String -> Bool rule1 = (>= 3) . length . filter (`elem` "aeiou") rule2 :: String -> Bool rule2 = (>= 1) . length . filter ((>= 2) . length) . group rule3 :: String -> Bool rule3 str = not $ "ab" `isInfixOf` str || "cd" `isInfixOf` str || "pq" `isInfixOf...
tomwadeson/adventofcode
05.hs
mit
593
0
12
126
251
137
114
15
1
{- Functional Morphology: Latin internal dictionary Copyright (C) 2004 Author: Markus Forsberg 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, o...
icemorph/icemorph
bin/FM/oldnorse/DictON.hs
cc0-1.0
1,954
36
7
464
367
188
179
56
1
-- -- Copyright (c) 2013 Bonelli Nicola <bonelli@antifork.org> -- -- 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. --...
beni55/cgrep
src/CGrep/CGrep.hs
gpl-2.0
3,243
0
18
1,067
656
366
290
49
2
-- -- Copyright (c) 2014 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
upgrade-db/Upgrade.hs
gpl-2.0
5,604
0
13
1,463
1,300
652
648
125
3
import Data.List on :: (b -> b -> c) -> (a -> b) -> a -> a -> c f `on` g = \x y -> f (g x) (g y) main = do print $ intersperse '.' "MONKEY" print $ intersperse 0 [1,2,3,4,5] print $ intercalate " " ["hey","there","guys"] print $ intercalate [0,0,0] [[1,2,3],[4,5,6],[7,8,9]] print $ transpose ...
solvery/lang-features
haskell/list_3.hs
gpl-2.0
4,198
3
16
1,109
2,468
1,394
1,074
85
1
module Hero.UI where import Control.Monad(when) import Data.Maybe(fromJust) import Data.Array.IArray(assocs) import UI.NCurses import Hero.Map -- | Update the NCurses UI by displaying the whole map. displayMap :: Map -> Update () displayMap m = do moveCursor 0 0 go 0 . assocs $ m where go :...
brennie/hero-old
Hero/UI.hs
gpl-3.0
818
0
12
330
281
142
139
20
2
-- Sortable Test -- Copyright (C) 2015 Jonathan Lamothe -- <jonathan@jlamothe.net> -- 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 3 of the -- License, or (at your option) any...
jlamothe/sortable-test
Daily/Types.hs
gpl-3.0
1,217
0
9
282
141
92
49
15
0
module SignaturesAnalyzerSpec(spec) where import Language.Mulang.Analyzer hiding (result, spec) import Test.Hspec result signatures = emptyCompletedAnalysisResult { signatures = signatures } run language content style = analyse (signaturesAnalysis (CodeSample language content) style) spec = de...
mumuki/mulang
spec/SignaturesAnalyzerSpec.hs
gpl-3.0
908
0
14
179
268
140
128
16
1
{-# LANGUAGE Rank2Types, NoMonomorphismRestriction, ScopedTypeVariables #-} module Database.Design.Ampersand.Test.Parser.ParserTest ( parseReparse, parseScripts, showErrors ) where import Prelude hiding (readFile) import Database.Design.Ampersand.ADL1.PrettyPrinters(prettyPrint) import Database.Design.Ampersand.Co...
DanielSchiavini/ampersand
src/Database/Design/Ampersand/Test/Parser/ParserTest.hs
gpl-3.0
1,504
0
14
250
478
260
218
28
2
{-# OPTIONS_GHC -fno-warn-orphans #-} module BlastItWithPiss.MonadChoice (module Control.Monad.Random ,MonadChoice ,chooseFromList ,chooseFromListMaybe ,generateRandomString ,generateSymbolString ) where import Import import Control.Monad.Trans.Class import Control.Monad.Trans.Resource im...
exbb2/BlastItWithPiss
src/BlastItWithPiss/MonadChoice.hs
gpl-3.0
2,120
0
13
377
625
337
288
46
1
module Main where import System.Environment(getArgs) import Control.Monad import Data.List import qualified Data.IntMap as IM digitRemainders :: IM.IntMap [Int] digitRemainders = IM.fromList [ (0,[0]), (1,[1]), (2,[2,4,8,6]), (3,[3,9,7,1]), (4,[4,6]), ...
cryptica/CodeEval
Challenges/144_DigitStatistics/main.hs
gpl-3.0
1,151
0
16
363
526
302
224
31
1
import System.Exit import Test.HUnit import StackMachine.Emulator (Opcode(..),memSize) import StackMachine.SMAssembler main = do Counts _ _ errors failures <- runTestTT tests if errors > 0 || failures > 0 then exitWith $ ExitFailure 1 else exitWith ExitSuccess testAdr = TestCase $ assertEqual "test Adr assem...
zebbo/stack-machine
test/SMAssemblerTests.hs
gpl-3.0
2,464
0
10
966
662
355
307
40
2
module MyStandardFunctions where myOr :: [Bool] -> Bool myOr [] = False myOr (x:xs) = if x == True then True else myOr xs myAny :: (a -> Bool) -> [a] -> Bool myAny _ [] = False myAny f (x:xs) = if f x == True then True else myAny f xs myElem :: Eq a => a -> [a] -> Bool myElem _ [] = False myElem x (l:ls)...
dkensinger/haskell
haskellbook/mystandardfunctions.hs
gpl-3.0
682
0
8
176
395
211
184
30
2
class Functor m => Monad m where join :: m (m a) -> m a return :: a -> m a
hmemcpy/milewski-ctfp-pdf
src/content/3.4/code/haskell/snippet14.hs
gpl-3.0
82
0
8
28
50
23
27
3
0
module Qual5(module Qual1) where import qualified Qual1 as Q f :: Bool f = True (/**) :: a -> Int -> Int _ /** z = 2 * g * z -- 12 * z where g = 3 * k -- 6 where k = 2 infixr 5 /** data Listt3 a = a :>>< (Qual5.Listt3 a) | Emptyy
Helium4Haskell/helium
test/exports/Qual5.hs
gpl-3.0
269
0
9
99
108
64
44
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeVpcEndpoints.hs
mpl-2.0
6,190
0
10
1,293
802
487
315
84
1
{--License: license.txt --} module CCAR.Parser.CCARParsec (readExpr, readExprTree, Stress) where import Import import Data.Text as Text import CCAR.Model.CcarDataTypes import CCAR.Model.Maturity import Control.Monad syntaxError i = CCARError $ Text.append "Invalid symbol " i symbol :: Parser Char symbol = oneOf ...
asm-products/ccar-websockets
CCAR/Parser/CCARParsec.hs
agpl-3.0
6,000
0
14
1,804
1,667
743
924
209
3
module Main where table :: [Integer] -> [(Integer, Integer, Integer)] table xs = [(x, y, x * y) | x <- xs, y <- xs]
Olical/langs
haskell/day1/table.hs
unlicense
124
0
7
33
68
40
28
3
1
{- | Module : Bio.Motions.Format.Handle Description : OutputBackend instance for binary format License : Apache Stability : experimental Portability : unportable -} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE DataKinds #-} {-# LANGUA...
Motions/motions
src/Bio/Motions/Format/Handle.hs
apache-2.0
8,896
0
25
2,236
2,161
1,079
1,082
172
2
-- | Generates the API for a configured kernel. module RISK.API ( generateAPI ) where import Text.Printf import RISK.Compile (indent, block) import RISK.Config import RISK.Spec -- | Generates the API files for a configured RISK kernel. generateAPI :: Spec -> IO () generateAPI spec = sequence_ [ do writeFile ("...
tomahawkins/risk
RISK/API.hs
bsd-2-clause
4,533
0
18
1,117
920
485
435
100
1
{-# LANGUAGE CPP, TemplateHaskell #-} {-| Shim library for supporting various Template Haskell versions -} {- Copyright (C) 2018 Ganeti Project Contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions ar...
mbakke/ganeti
src/Ganeti/THH/Compat.hs
bsd-2-clause
3,350
0
10
561
282
166
116
21
2
import System.IO main = getContents >>= putStrLn
mightymoose/RubyQuiz
quiz_2/solution.hs
bsd-2-clause
50
0
5
8
15
8
7
2
1
module Combinatorics.Symbolic.MathExpr.Parser where import Combinatorics.Symbolic.MathExpr import Text.Parsec import Text.Parsec.Expr import Text.Parsec.Token import Text.Parsec.Language (haskell) {- A few things I probably want to parse the tex version of the symbols or atleast something similiar -} ...
jfischoff/symbolic-combinatorics
src/Combinatorics/Symbolic/MathExpr/Parser.hs
bsd-3-clause
864
0
5
283
133
83
50
24
1
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeSynonymInstances #-} {- Copyright (c) 2013, Markus Barenhoff <alios@alios.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are pe...
alios/nauticlib
src/Data/ISO8211/Parser.hs
bsd-3-clause
17,795
0
20
4,638
5,412
2,792
2,620
377
11
module Data.Rivers.Idiom where import Prelude (($)) class Idiom f where pure :: a -> f a srepeat :: a -> f a (<>) :: f (a -> b) -> f a -> f b smap :: (a -> b) -> f a -> f b zip :: (a -> b -> c) -> f a -> f b -> ...
d-rive/rivers
Data/Rivers/Idiom.hs
bsd-3-clause
468
0
10
246
206
108
98
13
0
module Data.Time.LocalTime ( module Data.Time.LocalTime.TimeZone, module Data.Time.LocalTime.TimeOfDay, module Data.Time.LocalTime.LocalTime ) where import Data.Time.LocalTime.TimeZone import Data.Time.LocalTime.TimeOfDay import Data.Time.LocalTime.LocalTime
bergmark/time
lib/Data/Time/LocalTime.hs
bsd-3-clause
272
0
5
30
54
39
15
8
0
{-# LANGUAGE FlexibleInstances #-} module Patch where import Control.Applicative import Control.Monad.ST import Data.Array import Data.List import Data.Random import Data.Random.Extras import System.Random import Row import Tile import Utilities import Maze data Dimensions = Dimensions Int Int deriving Show data Pat...
hans25041/gringotz-level
src/Patch.hs
bsd-3-clause
2,621
0
14
689
1,228
640
588
74
3
{-# LANGUAGE OverloadedStrings, PackageImports #-} import Control.Applicative import Control.Monad import "monads-tf" Control.Monad.State import Control.Concurrent import Data.HandleLike import Network import Network.PeyoTLS.Server import Network.PeyoTLS.ReadFile import "crypto-random" Crypto.Random import qualified ...
YoshikuniJujo/forest
subprojects/tls-analysis/server/examples/simpleServer.hs
bsd-3-clause
1,171
12
17
214
414
222
192
34
2
module PPTest.Builders.Nfa (specs) where import qualified Data.Char as C import qualified Data.Graph.Inductive.Graph as Gr import PP import PP.Builders.Nfa import PP.Grammars.Lexical import Test.Hspec -- Utilities getNfa expr = let Right ast = (parseAst expr ::...
chlablak/platinum-parsing
test/PPTest/Builders/Nfa.hs
bsd-3-clause
4,212
0
21
1,268
1,902
1,136
766
73
1
module Matterhorn.State.ThemeListOverlay ( enterThemeListMode , themeListSelectDown , themeListSelectUp , themeListPageDown , themeListPageUp , setTheme ) where import Prelude () import Matterhorn.Prelude import Brick ( invalidateCache ) import Brick.Themes ( th...
matterhorn-chat/matterhorn
src/Matterhorn/State/ThemeListOverlay.hs
bsd-3-clause
2,857
0
15
633
553
299
254
-1
-1
module Hydra.Stages.Validate (validate) where import Hydra.Data validate :: SymTab -> SymTab validate st = let neq = length (equations st) nvar = variableNumber st msg = "Number of equations (" ++ show neq ++ ") and variables (" ++ show nvar ++ ") do not agree in the model." ++ "\n" in if (neq == nvar...
giorgidze/Hydra
src/Hydra/Stages/Validate.hs
bsd-3-clause
360
0
14
94
111
58
53
10
2
module Main where import Data.Maybe import Test.HUnit import Market.Types import Market.Util import Market.Coins --------------------------------------- main :: IO Counts main = runTestTT tests tests :: Test tests = TestList [ TestLabel "Orderbook equality works" quoteBookEq , TestLabel "Aggregate and...
dimitri-xyz/market-model
test/Test.hs
bsd-3-clause
7,590
0
16
1,889
2,860
1,661
1,199
144
1
{-# LANGUAGE FlexibleContexts #-} module RDSTests.Util ( testRDS , withDBInstance , waitUntilNotFound , withDBSnapshot , withEventSubscription , withDBParameterGroup , withDBSecurityGroup , withOptionGroup ) where import qualified Control.Concurrent as CC import qualified Contr...
worksap-ate/aws-sdk
test/RDSTests/Util.hs
bsd-3-clause
3,417
0
15
792
973
500
473
99
2
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} -- | -- Module: $HEADER$ -- Description: TODO -- Copyright: (c) 2016 Peter Trško -- License: BSD3 -- -- Stability: experimental -- Portability: GHC specific language exten...
FPBrno/dht-api
src/Data/DHT/Type/Hash.hs
bsd-3-clause
4,747
0
14
1,452
961
559
402
70
3
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section[TcBinds]{TcBinds} -} {-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} module TcBinds ( tcLocalBinds, tcTopBinds, ...
sdiehl/ghc
compiler/typecheck/TcBinds.hs
bsd-3-clause
73,468
1
23
23,085
11,678
6,155
5,523
832
9
-- hisg - IRC stats generator. -- -- Copyright (c) 2009, 2010 Antoine Kalmbach <antoine dot kalmbach at jyu dot fi> -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of so...
ane/hisg
src/Hisg/Stats.hs
bsd-3-clause
4,655
0
15
888
988
576
412
47
2
{-| Description: SDL timer support. -} module Graphics.UI.SDL.Timer ( module Ticks ) where import Graphics.UI.SDL.Timer.Ticks as Ticks
abbradar/MySDL
src/Graphics/UI/SDL/Timer.hs
bsd-3-clause
151
0
4
33
25
19
6
3
0
-- | -- Module : Network.TLS.Sending -- License : BSD-style -- Maintainer : Vincent Hanquez <vincent@snarc.org> -- Stability : experimental -- Portability : unknown -- -- the Sending module contains calls related to marshalling packets according -- to the TLS state -- module Network.TLS.Sending (writePacket...
tolysz/hs-tls
core/Network/TLS/Sending.hs
bsd-3-clause
3,995
0
18
952
1,003
508
495
66
4
{-# LANGUAGE OverloadedStrings #-} module Parser where import Control.Applicative import Control.Comonad.Cofree import Control.Monad (void) import Data.Char (digitToInt) import Data.List (foldl') import Data.String (IsString(..)) import qualified Data.Text as T import qualified Data.Text.Encoding as T import Text.Trif...
ethercrow/unused-defns
Parser.hs
bsd-3-clause
4,797
0
15
1,256
1,632
872
760
117
2
module SubListKata.Day7 (sublist, Result(..)) where import Data.List(isInfixOf) data Result = Equal | Unequal | Sublist | Superlist deriving(Show, Eq) sublist :: (Ord a) => [a] -> [a] -> Result sublist [] [] = Equal sublist [] _ = Sublist sublist _ [] = Superlist sublist l...
Alex-Diez/haskell-tdd-kata
old-katas/src/SubListKata/Day7.hs
bsd-3-clause
457
0
8
149
178
94
84
13
1
{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-} module Grab where import BasePrelude hiding (try, takeWhile) import Control.Lens import Data.Attoparsec.Text.Lazy import qualified Data.ByteString.Lazy as BSL import qualified Data.Text.Lazy.Encoding as TLE import qualified Data.Text.Lazy as TL import Graphics.Ren...
hlian/zwischenzug
Grab.hs
bsd-3-clause
2,593
0
20
619
935
495
440
75
2
----------------------------------------------------------------------------- -- -- Module : Text.XML.Plist -- Copyright : (c) Yuras Shumovich 2009 -- License : BSD3 -- -- Maintainer : shumovichy@gmail.com -- Stability : experimental -- Portability : portable -- -- |Library for generation and parsin...
tomgr/webcspm
src/Text/XML/Plist.hs
bsd-3-clause
731
0
5
92
86
63
23
17
0
-- | aws-sdk is an AWS library for Haskell -- -- Put your AWS AccessKey and SecretAccessKey into a configuration -- file. Write the following in /./\//aws.config/. -- -- > accessKey: your-access-key -- > secretAccessKey: your-secret-access-key -- -- The following is quick example(DescribeInstances). -- -- > module Exam...
IanConnolly/aws-sdk-fork
AWS.hs
bsd-3-clause
1,163
0
5
272
80
64
16
14
0
{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- ...
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CreateImage.hs
mpl-2.0
6,783
0
13
1,466
967
582
385
114
1
module Cardano.Wallet.API.V1.Handlers.Wallets where import Universum import Servant import Cardano.Wallet.API.Request import Cardano.Wallet.API.Response import Cardano.Wallet.API.V1.Types as V1 import qualified Cardano.Wallet.API.V1.Wallets as Wallets import ...
input-output-hk/cardano-sl
wallet/src/Cardano/Wallet/API/V1/Handlers/Wallets.hs
apache-2.0
3,471
0
13
990
829
409
420
-1
-1
{-# LANGUAGE CPP, DataKinds, TypeOperators, TypeApplications, TypeFamilies #-} #if __GLASGOW_HASKELL__ >= 805 {-# LANGUAGE NoStarIsType #-} #endif {-# OPTIONS_GHC -fdefer-type-errors #-} {-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-} {-# OPTIONS_GHC -fplugin GHC.TypeLits.KnownNat.Solver #-} {-# OPTIONS_GHC -fplugi...
christiaanb/ghc-typelits-extra
tests/ErrorTests.hs
bsd-2-clause
8,568
0
13
1,944
1,495
805
690
140
1
module Notify (testNotify) where import Common import Control.Applicative import Control.Concurrent import Control.Monad import Data.Function import Data.List import Database.PostgreSQL.Simple.Notification import qualified Data.ByteString as B -- TODO: Test with payload, but only for PostgreSQL >= 9.0 -- (when that...
tomjaguarpaw/postgresql-simple
test/Notify.hs
bsd-3-clause
1,163
0
13
286
273
138
135
-1
-1
module Main where foo x = baz where foo = 2 two = 4 where bax = 4
mpickering/ghc-exactprint
tests/examples/transform/NormaliseLayout.hs
bsd-3-clause
77
0
8
29
31
18
13
4
1
{-# LANGUAGE OverloadedStrings #-} module Main (main) where import GitHub.Data.Id (Id (..)) import qualified GitHub.Endpoints.Users.PublicSSHKeys as PK import qualified GitHub.Auth as Auth main :: IO () main = do let auth = Auth.OAuth "auth_token" ePublicSSHKey <- PK.publicSSHKey' auth (Id 18528451) case ePubli...
jwiegley/github
samples/Users/PublicSSHKeys/ShowPublicSSHKey.hs
bsd-3-clause
441
0
12
76
144
79
65
12
2
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# L...
kim/amazonka
amazonka-route53/gen/Network/AWS/Route53/ListHostedZones.hs
mpl-2.0
7,593
0
16
1,627
960
568
392
99
1
{- Linux library copier and binary shimmer - - Copyright 2013 Joey Hess <joey@kitenet.net> - - License: BSD-2-clause -} module Utility.LinuxMkLibs where import Control.Applicative import Data.Maybe import System.Directory import System.FilePath import Data.List.Utils import System.Posix.Files import Data.Char im...
avengerpenguin/propellor
src/Utility/LinuxMkLibs.hs
bsd-2-clause
1,911
6
15
331
444
226
218
37
1
{- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Loading interface files -} {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module LoadIface ( -- Importing one thing tcLookupImported_maybe, importDecl, checkWiredInTyCon, ifCheckWiredIn...
shlevy/ghc
compiler/iface/LoadIface.hs
bsd-3-clause
52,642
479
24
17,086
8,598
4,602
3,996
-1
-1
------------------------------------------------------------------------------- -- -- | Main API for compiling plain Haskell source code. -- -- This module implements compilation of a Haskell source. It is -- /not/ concerned with preprocessing of source files; this is handled -- in "DriverPipeline". -- -- There are var...
lukexi/ghc-7.8-arm64
compiler/main/HscMain.hs
bsd-3-clause
66,217
7
28
19,708
11,068
5,667
5,401
-1
-1
{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE ConstraintKinds #-} -- | Cache information about previous builds module Stack.Build.Cache ( tryGetBuildCache , tryGetConfigCache , tr...
rvion/stack
src/Stack/Build/Cache.hs
bsd-3-clause
12,323
0
17
3,332
2,694
1,377
1,317
229
2
-- ---------------------------------------------------------------------------- -- | Handle conversion of CmmData to LLVM code. -- module LlvmCodeGen.Data ( genLlvmData ) where #include "HsVersions.h" import Llvm import LlvmCodeGen.Base import BlockId import CLabel import Cmm import FastString import q...
jwiegley/ghc-release
compiler/llvmGen/LlvmCodeGen/Data.hs
gpl-3.0
4,136
0
16
928
1,025
517
508
78
3
{-# LANGUAGE CPP #-} import Control.Monad import Data.IORef import Control.Exception (SomeException, catch) import Distribution.Simple import Distribution.Simple.BuildPaths (autogenModulesDir) import Distribution.Simple.InstallDirs as I import Distribution.Simple.LocalBuildInfo as L import qualified Distribution.Simp...
ben-schulz/Idris-dev
Setup.hs
bsd-3-clause
12,983
0
17
3,418
2,555
1,315
1,240
197
3