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
module Network.Email.Render where import Data.Monoid import Data.Maybe import Control.Monad import Data.Bits import qualified Data.Map as M import qualified Data.ByteString.Char8 as B import qualified Data.ByteString.Lazy.Char8 as BL import qualified Data.ByteString.Builder as BL import qualified Data.Text as T import...
abbradar/email
src/Network/Email/Render.hs
bsd-3-clause
3,202
0
22
833
967
513
454
-1
-1
module Algebra.Structures.Group ( module Algebra.Structures.Monoid , Group(..) , (<->) ) where import Algebra.Structures.Monoid class Monoid a => Group a where neg :: a -> a (<->) :: Group a => a -> a -> a a <-> b = a <+> neg b infixl 6 <->
Alex128/abstract-math
src/Algebra/Structures/Group.hs
bsd-3-clause
268
0
7
73
104
59
45
10
1
{-# 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 #-} -- ...
ambiata/mismi
mismi-s3/src/Mismi/S3/Patch/PutObjectACL.hs
bsd-3-clause
7,476
0
13
1,655
1,329
781
548
156
1
{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} module Ivory.Tower.AST.SyncChan where #if MIN_VERSION_mainland_pretty(0,6,0) import Text.PrettyPrint.Mainland.Class #endif import Text.PrettyPrint.Mainland import qualified Ivory.Language.Syntax.Type as I data SyncChan...
GaloisInc/tower
tower/src/Ivory/Tower/AST/SyncChan.hs
bsd-3-clause
543
0
9
86
116
70
46
13
0
import System.GlobalLock import Control.Concurrent.MVar import Criterion.Main main :: IO () main = do mVar <- newMVar () defaultMain [ bench "bare" $ (return () :: IO ()) , bench "MVar" $ withMVar mVar (const $ return ()) , bench "global" $ lock (return ()) ]
kmcallister/global-lock
test/bench.hs
bsd-3-clause
298
0
14
83
124
61
63
10
1
module Chapter01 where import Control.Monad ( liftM2 ) import Control.Monad.Trans.Class ( lift ) import Control.Monad.Trans.State ( StateT, evalStateT, modify, gets ) import Data.List ( intersperse ) import Data.Maybe ( fromMaybe ) -------------------------------------------------------------------------------- type...
svenpanne/tiger
chapter01/SLP.hs
bsd-3-clause
4,884
0
17
1,286
1,590
836
754
100
1
{-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE PatternGuards #-} {- | Module : V...
GaloisInc/saw-script
saw-core/src/Verifier/SAW/Term/Pretty.hs
bsd-3-clause
29,774
0
20
6,650
7,009
3,663
3,346
-1
-1
{-# LANGUAGE OverloadedStrings #-} module Main where import Imo.App import Network.Wai.Middleware.Gzip (gzip, def) import Network.Wai.Handler.Warp (run, Port) import System.Environment (getEnvironment) import Control.Monad (liftM) main :: IO () main = do port <- getPort run port $ gzip def imoApp getPort :: IO...
IMOKURI/wai-example-using-buildpack-stack
src/Main.hs
bsd-3-clause
468
0
8
79
144
80
64
16
1
{-| Module : Data.Number.MPFR.Assignment Description : wrappers for assignment functions Copyright : (c) Aleš Bizjak License : BSD3 Maintainer : ales.bizjak0@gmail.com Stability : experimental Portability : non-portable Conversion from basic Haskell types to MPFR. S...
ekmett/hmpfr
src/Data/Number/MPFR/Assignment.hs
bsd-3-clause
5,290
0
24
1,939
1,577
801
776
93
1
{-# 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-glacier/gen/Network/AWS/Glacier/InitiateMultipartUpload.hs
mpl-2.0
8,747
0
13
1,703
918
562
356
109
1
-- | RGBA module Graphics.FreetypeGL.RGBA ( RGBA(..), noColor, toVec4, withVec ) where import Bindings.FreetypeGL.Vec234 (C'vec4(..)) import Foreign.Marshal.Alloc (alloca) import Foreign.Ptr (Ptr) import Foreign.Storable (Storable(..)) data RGBA = RGBA !Float !Float !Float !Float deriving (Eq, Ord, Read,...
Peaker/FreeTypeGL
src/Graphics/FreetypeGL/RGBA.hs
bsd-3-clause
658
0
11
157
263
141
122
31
1
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "dist/dist-sandbox-261cd265/build/System/Posix/Process.hs" #-} {-# LINE 1 "System/Posix/Process.hsc" #-} {-# LINE 2 "System/Posix/Process.hsc" #-} {-# LANGUAGE Safe #-} {-# LINE 6 "System/Posix/Process.hsc" #-} -------------------------------------------------------------------...
phischu/fragnix
tests/packages/scotty/System.Posix.Process.hs
bsd-3-clause
3,920
0
24
939
614
351
263
70
3
{-# LANGUAGE Haskell2010 #-} {-# LINE 1 "Control/DeepSeq.hs" #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DefaultSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE Safe #-} {-# LANGUAGE PolyKinds #-} ------...
phischu/fragnix
tests/packages/scotty/Control.DeepSeq.hs
bsd-3-clause
17,982
0
14
4,473
4,473
2,458
2,015
260
1
{-# LANGUAGE Haskell98 #-} {-# LINE 1 "Network/Wai/Handler/Warp/Request.hs" #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} ...
phischu/fragnix
tests/packages/scotty/Network.Wai.Handler.Warp.Request.hs
bsd-3-clause
11,536
0
19
3,535
2,395
1,275
1,120
217
7
{-# LANGUAGE MagicHash, UnboxedTuples, TypeFamilies #-} -- | -- Module : Control.Monad.Primitive -- Copyright : (c) Roman Leshchinskiy 2009 -- License : BSD-style -- -- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au> -- Portability : non-portable -- -- Primitive state-transformer monads -- module Co...
rleshchinskiy/primitive
Control/Monad/Primitive.hs
bsd-3-clause
3,400
0
14
667
830
451
379
63
1
{-# LANGUAGE CPP, BangPatterns #-} module Network.Wai.Handler.Warp.MultiMap ( MMap , isEmpty , empty , singleton , insert , search , searchWith , pruneWith , toList , merge ) where #if __GLASGOW_HASKELL__ < 709 import Control.Applicative ((<$>)) #endif import Data.IntMap.Strict (IntMap) import...
utdemir/wai
warp/Network/Wai/Handler/Warp/MultiMap.hs
mit
2,151
0
15
461
656
349
307
48
3
-- | -- The integration tests have no ghc present, initially. Stack should not -- require ghc present to run the `clean` command. import StackTest main :: IO () main = do -- `stack clean` should succeed even though there is no ghc available. -- See the stack.yaml file for how this works. stackIgnoreException ["...
juhp/stack
test/integration/tests/4181-clean-wo-dl-ghc/Main.hs
bsd-3-clause
345
0
8
66
36
20
16
5
1
{-# LANGUAGE StandaloneDeriving #-} module Distribution.Server.Packages.UnpackTest ( testPermissions, ) where import qualified Codec.Archive.Tar as Tar import qualified Codec.Archive.Tar.Entry as Tar import qualified Codec.Archive.Tar.Check as Tar import qualified Codec.Compression.GZip as GZip import qualif...
ocharles/hackage-server
tests/Distribution/Server/Packages/UnpackTest.hs
bsd-3-clause
1,271
0
14
191
296
167
129
25
1
{-# LANGUAGE GADTs, DisambiguateRecordFields #-} module CmmProcPoint ( ProcPointSet, Status(..) , callProcPoints, minimalProcPointSet , splitAtProcPoints, procPointAnalysis , attachContInfoTables ) where import Prelude hiding (last, unzip, succ, zip) import DynFlags import BlockId import CLabel i...
green-haskell/ghc
compiler/cmm/CmmProcPoint.hs
bsd-3-clause
20,858
0
20
6,419
3,145
1,613
1,532
211
13
{-# OPTIONS_GHC -Wall #-} module Canonicalize.Type (tipe) where import Control.Applicative ((<$>),(<*>)) import qualified Data.Traversable as Trav import qualified AST.Type as T import qualified AST.Variable as Var import qualified Reporting.Annotation as A import qualified Reporting.Error.Canonicalize as Error impo...
pairyo/elm-compiler
src/Canonicalize/Type.hs
bsd-3-clause
2,329
0
17
658
750
393
357
68
5
module HAD.Y2014.M04.D11.Exercise where {- | thirdOfFive return the third of five arguments No other interest than pointFree prop> \(x1, x2, x3, x4, x5) -> thirdOfFive x1 x2 x3 x4 x5 == (x3 :: Int) -} thirdOfFive :: a -> b -> c -> d -> e -> c thirdOfFive = undefined
weima/1HAD
exercises/HAD/Y2014/M04/D11/Exercise.hs
mit
282
0
9
66
40
24
16
3
1
{-# LANGUAGE CPP #-} {- Copyright (C) 2009 John MacFarlane <jgm@berkeley.edu> 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. ...
bergmannf/gitit
src/Network/Gitit/Plugins.hs
gpl-2.0
3,199
0
20
707
465
238
227
16
1
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds, PolyKinds #-} module T13398b where import GHC.TypeLits class C a where type T a (b :: Bool) :: a instance C Nat where type T Nat 'True = 1 type T Nat 'False = 0
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/T13398b.hs
bsd-3-clause
225
0
7
52
68
40
28
9
0
{-# LANGUAGE CPP #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE PatternGuards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RankNTypes #-} -- | Some helpers for parsing data out of a raw WAI 'Request'. module Network.Wai.Parse ( parseHttpAccept , parseRequestBody , RequestBodyType (..) , ...
AndrewRademacher/wai
wai-extra/Network/Wai/Parse.hs
mit
14,638
0
26
5,215
4,661
2,344
2,317
351
8
module Main (main) where import B main = print b
urbanslug/ghc
testsuite/tests/driver/recomp007/b/Main.hs
bsd-3-clause
51
0
5
12
20
12
8
3
1
module Estruturas.Complexidade where data Complexidade = Simples | Multigrafo deriving (Show, Eq) instance Ord Complexidade where Simples `compare` Simples = EQ Simples `compare` Multigrafo = LT Multigrafo `compare` Simples = GT Multigrafo `compare` ...
jean-lopes/grafos
src/Estruturas/Complexidade.hs
mit
336
0
6
106
87
48
39
9
0
{-# htermination exponent :: Float -> Int #-}
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/Prelude_exponent_1.hs
mit
46
0
2
8
3
2
1
1
0
import qualified Data.Array.Unboxed as A import qualified Data.HashMap.Strict as M factorial :: Int -> Int factorial 0 = 1 factorial n = go n 1 where go 1 acc = acc go n' acc = go (n' - 1) (n' * acc) solve :: Int -> Int solve n = sum [x | x <- [3..n], (sum $ digitFactorials x) == x] where digitFactori...
jwtouron/haskell-play
ProjectEuler/Problem34.hs
mit
641
0
11
155
303
164
139
17
2
{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE UndecidableSuperClasses #-} {-# LANGUAGE FlexibleInstances #-} {-| Type family and class definitions for de...
clintonmead/indextype
src/Control/IndexT/Tuple.hs
mit
8,225
0
7
1,811
3,465
1,735
1,730
-1
-1
module MaybeUtils where import Data.Maybe import Control.Monad --http://hackage.haskell.org/package/syb-0.5.1/docs/src/Data-Generics-Aliases.html#orElse -- | Left-biased choice on maybes orElse :: Maybe a -> Maybe a -> Maybe a x `orElse` y = case x of Just _ -> x Nothing -...
holdenlee/fluidity
MaybeUtils.hs
mit
793
0
12
313
230
119
111
17
3
{-# LANGUAGE ConstraintKinds #-} module Test where import ClassyPrelude import Control.Monad.Classes import Control.Monad.Writer (runWriterT) import Text.Printf import N import GUI.Fake import Helpers import Notes import Command import ClassesLens type Test' m = (M' m, Fake' m, MonadWriter [Text] m) type Test = ...
aelve/Jane
Test.hs
mit
1,526
0
11
408
288
149
139
-1
-1
{-# OPTIONS_GHC -fno-warn-missing-signatures #-} import qualified Commands.Servers.Simple main = Commands.Servers.Simple.main
sboosali/commands
commands-server-simple/executables/Main.hs
mit
126
0
5
10
18
12
6
3
1
-- vim: set ts=2 sw=2 sts=0 ff=unix foldmethod=indent: {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE PostfixOperators #-} module MixKenallGeocode.KenAllCsvSpec where import SpecHelper import qualified Text.Parsec as P import MixKenallGeocode.KenAllCsv spec :: Spec spec = do describe "parseAreaOption" $ do c...
eji/mix-kenall-geocode
test/MixKenallGeocode/KenAllCsvSpec.hs
mit
2,684
0
18
554
107
57
50
14
1
{-# LANGUAGE PackageImports #-} {-# OPTIONS_GHC -fno-warn-dodgy-exports -fno-warn-unused-imports #-} -- | Reexports "Control.Monad.Fail.Compat" -- from a globally unique namespace. module Control.Monad.Fail.Compat.Repl.Batteries ( module Control.Monad.Fail.Compat ) where import "this" Control.Monad.Fail.Compat
haskell-compat/base-compat
base-compat-batteries/src/Control/Monad/Fail/Compat/Repl/Batteries.hs
mit
314
0
5
31
32
25
7
5
0
-- Tree.hs module Tree where import Data.Monoid data TravelGuide = TravelGuide { title :: String, authors :: [String], price :: Double } deriving (Show, Eq, Ord) newtype TravelGuidePrice = TravelGuidePrice TravelGuide deriving Eq instance Ord TravelGuidePrice where (TravelGuidePri...
hnfmr/beginning_haskell
Tree.hs
mit
1,568
0
14
515
579
299
280
33
3
{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveDataTypeable #-} -------------------------------------------------------------------- -- | -- Copyright : © Oleg Grenrus 2014 -- License : MIT -- Maintainer: Oleg Grenrus <oleg.grenrus@iki.fi> -- Stability : experimental -- Portabil...
phadej/boolean-normal-forms
src/Data/Algebra/Boolean/FreeBoolean.hs
mit
2,158
0
8
469
589
329
260
45
0
{-# htermination plusFM_C :: (Ord a, Ord k) => (b -> b -> b) -> FiniteMap (a,k) b -> FiniteMap (a,k) b -> FiniteMap (a,k) b #-} import FiniteMap
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/full_haskell/FiniteMap_plusFM_C_12.hs
mit
145
0
3
29
5
3
2
1
0
-- Problems/Problem014.hs module Problems.Problem014 (p14) where import Data.List import Helpers.Numbers main = print p14 p14 :: Int p14 = snd $ foldl1' max $ map (\x -> ((length $ collatz x),x)) [500001,500003..999999] collatzList :: Int -> [(Int,Int)] collatzList num | num == 1 = [(1,1)] | otherwise = (n...
Sgoettschkes/learning
haskell/ProjectEuler/src/Problems/Problem014.hs
mit
588
0
12
155
260
141
119
17
2
module Handler.HomeSpec (spec) where import TestImport spec :: Spec spec = withApp $ do it "loads the index and checks it looks right" $ do get HomeR statusIs 200 htmlAllContain "h1" "Welcome to Yesod" request $ do setMethod "POST" setUrl HomeR ...
ruHaskell/ruhaskell-yesod
test/Handler/HomeSpec.hs
mit
668
0
14
215
130
56
74
18
1
-- -- {{{1 -- -- File : Flx/Euler.hs -- Maintainer : Felix C. Stegerman <flx@obfusk.net> -- Date : 2012-06-28 -- -- Copyright : Copyright (C) 2012 Felix C. Stegerman -- Licence : GPLv2 -- -- Depends : ... -- Description : ... -...
obfusk/hs-flx
src/Flx/Euler.hs
gpl-2.0
1,079
0
11
419
217
128
89
13
1
{-# LANGUAGE CPP, DoAndIfThenElse #-} {- | Module : ./PGIP/Shared.hs Description : Provides resources for caching requests to the RESTful interface. License : GPLv2 or higher, see LICENSE.txt This module provides various Hets resources that are used t.e. for caching of an analysis library during a request to ...
spechub/Hets
PGIP/Shared.hs
gpl-2.0
2,223
0
9
434
437
262
175
40
2
module Parser where import Text.ParserCombinators.Parsec hiding (spaces, (<|>)) import System.Environment import Control.Applicative hiding (many) import Types import Control.Monad.Error symbol :: Parser Char symbol = oneOf "!#$%&|*+-/:<=>?@^_~" spaces :: Parser () spaces = skipMany1 space parseString :: Parser Lis...
5outh/wyas
Parser.hs
gpl-2.0
1,701
0
13
380
577
298
279
46
3
module Kontinuation (Kontinuation(Application, Assignment, Block, Branch, Root)) where import Expression import Value import Text.JSON import JSON data Kontinuation = Application [Expression] [Value] Environment Kontinuation | Assignment String Environment Kontinuation | Block Exp...
lachrist/kusasa-hs
kontinuation.hs
gpl-2.0
3,025
0
11
971
852
439
413
43
1
{-# LANGUAGE OverloadedStrings #-} module Main where import Control.Exception import Control.Monad import Control.Monad.Reader import Data.Attoparsec.Text import qualified Data.ByteString as B import Data.Int import Data.Monoid import Da...
Arguggi/irc-log
backend/app/bot/Main.hs
gpl-3.0
4,387
0
14
1,139
1,291
654
637
99
2
{-# LANGUAGE PackageImports #-} {-# LANGUAGE ExistentialQuantification #-} import Control.Applicative ((<$>), (*>), (<*), (<*>)) import Control.Monad (liftM) import "mtl" Control.Monad.Error import Data.IORef import System.Environment (getA...
TrevorBender/lithp
src/Lisp.hs
gpl-3.0
19,964
0
16
5,420
6,711
3,430
3,281
413
3
{-# LANGUAGE DisambiguateRecordFields, TypeFamilies, StandaloneDeriving, DeriveFunctor, DeriveFoldable, GeneralizedNewtypeDeriving #-} ------------------------------------------------------------------------------------- -- | -- Copyright : (c) Hans Hoglund 2012 -- -- License : BSD-style -- -- Maintainer :...
hanshoglund/modulo
src/Language/Modulo.hs
gpl-3.0
7,772
0
11
2,144
1,178
742
436
112
1
ma >>= f = join (fmap f ma)
hmemcpy/milewski-ctfp-pdf
src/content/3.4/code/haskell/snippet13.hs
gpl-3.0
27
0
7
7
23
10
13
1
1
{-# LANGUAGE NoImplicitPrelude #-} module Lamdu.Sugar.Convert.GetField ( convert ) where import Prelude.Compat import qualified Control.Lens as Lens import Control.Lens.Operators import Control.Monad (guard) import Control.MonadA (MonadA) import qualified Data.Map as Ma...
rvion/lamdu
Lamdu/Sugar/Convert/GetField.hs
gpl-3.0
2,907
0
18
870
724
403
321
-1
-1
module Examples.ImageProcessing.Grayscale where import Prelude import QFeldspar.QDSL import Examples.ImageProcessing.Prelude grayscale :: Qt (Image -> Image) grayscale = [|| \ image -> $$mkImage ($$heightImage image) ($$widthImage image) (\ i j -> let p = $$getPixel image i j ...
shayan-najd/QFeldspar
Examples/ImageProcessing/Grayscale.hs
gpl-3.0
680
2
19
309
203
106
97
-1
-1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
rueshyna/gogol
gogol-webmaster-tools/gen/Network/Google/Resource/Webmasters/Sitemaps/Get.hs
mpl-2.0
3,164
0
14
731
386
233
153
62
1
{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators ...
brendanhay/gogol
gogol-appengine/gen/Network/Google/Resource/AppEngine/Apps/Services/Patch.hs
mpl-2.0
7,186
0
21
1,644
1,031
602
429
149
1
module Simplifier where import Data.List (nub) import Language.SMTLib2 import Language.SMTLib2.Internals import Language.SMTLib2.Internals.Operators isFalse :: SMTExpr Bool -> Bool isFalse (Const False _) = True isFalse _ = False isTrue :: SMTExpr Bool -> Bool isTrue (Const True _) = True isTrue _ = False simplifi...
hguenther/nbis
Simplifier.hs
agpl-3.0
1,852
0
18
790
630
311
319
49
17
{-# OPTIONS_GHC -F -pgmF ./dist/build/htfpp/htfpp #-} module Tutorial where import System.Environment ( getArgs ) import System.Exit ( exitWith ) import Test.Framework {- myReverse :: [a] -> [a] myReverse [] = [] myReverse [x] = [x] myReverse (x:xs) = myReverse xs -} myReverse :: [a] -> [a] myReverse [] = [] myRever...
ekarayel/HTF
tests/Tutorial.hs
lgpl-2.1
747
0
10
138
242
134
108
17
1
module Data.GI.CodeGen.OverloadedSignals ( genObjectSignals , genInterfaceSignals , genOverloadedSignalConnectors ) where #if !MIN_VERSION_base(4,8,0) import Control.Applicative ((<$>)) #endif import Control.Monad (forM_, when) import Data.Monoid ((<>)) import Data.Text (Text) import qualified Data.Te...
hamishmack/haskell-gi
lib/Data/GI/CodeGen/OverloadedSignals.hs
lgpl-2.1
5,082
0
24
1,326
1,343
678
665
101
4
{-# LANGUAGE ExistentialQuantification #-} module Development.Fex.Experiment ( Experiment, Dependency, Effect, Depend(..) , dependsExper, dep, dependStatus, resolve , effectsExper, effect , flagsExper, addFlag, flagValue , evalExper , liftIO , experFail , setName, getName ) where import Control.Appli...
BurntSushi/fex
Development/Fex/Experiment.hs
unlicense
9,713
0
17
2,312
2,220
1,201
1,019
135
3
-- Copyright 2012-2014 Samplecount S.L. -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agr...
samplecount/shake-language-c
src/Development/Shake/Language/C/Target/Linux.hs
apache-2.0
2,090
0
13
359
320
174
146
35
1
module Listener (main) where import Ros.Node import qualified Ros.Std_msgs.String as S showMsg :: S.String -> IO () showMsg = putStrLn . ("I heard " ++) . S._data main = runNode "listener" $ runHandler showMsg =<< subscribe "chatter"
rgleichman/roshask
Examples/PubSub/src/Listener.hs
bsd-3-clause
236
0
7
39
80
45
35
6
1
{-# LANGUAGE DeriveGeneric, FlexibleInstances, OverlappingInstances, UndecidableInstances #-} -- -- 0k/pong message definitions. Incoming/outgoing datatype and the corresponding -- JSON and on-the-wire protobuf representations. -- -- Caveat: datatype definitions themself entail protobuf encoding. No .proto -- files. -...
element-doo/ekade
code/haskell/src/Types.hs
bsd-3-clause
1,294
0
11
242
367
208
159
-1
-1
-- BNF Converter: Error Monad -- Copyright (C) 2004 Author: Aarne Ranta -- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE. module ErrM where -- the Error monad: like Maybe type with error msgs import Control.Monad (MonadPlus(..), liftM) import Control.Applicative (Applicative(..), Altern...
MichaelMcCulloch/MPlusPlus
src/ErrM.hs
bsd-3-clause
835
0
8
240
262
141
121
23
0
{-# OPTIONS_HADDOCK show-extensions #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} module Control.THEff.Reader ( -- * Overview -- | -- This version builds its output lazily; for a strict version with -- the same interface, see "Control.THEff.Re...
KolodeznyDiver/THEff
src/Control/THEff/Reader.hs
bsd-3-clause
3,599
0
15
1,152
635
367
268
39
3
module Main where import App main :: IO () main = run ":memory:"
CatzScience/sassy
server/src/Main.hs
bsd-3-clause
67
0
6
15
25
14
11
4
1
{-# LANGUAGE RankNTypes #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} -- | Note - this API is designed to support a narrow (but common!) set -- of use cases. If you find that you need more customization than this -- offers, then you will need to ...
sjakobi/brick
src/Brick/Forms.hs
bsd-3-clause
36,986
0
27
12,487
6,147
3,313
2,834
434
9
module Wigner.Transformations( wignerTransformation, positivePTransformation, truncateDifferentials, showTexByDifferentials, wignerOfLossTerm, ) where import Wigner.Complex import Wigner.Expression import Wigner.Deltas import Wigner.ExpressionHelpers import Wigner.Texable import qualified Wigne...
fjarri/wigner
src/Wigner/Transformations.hs
bsd-3-clause
9,470
0
17
1,984
3,128
1,619
1,509
150
5
{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-missing-import-lists #-} {-# OPTIONS_GHC -fno-warn-implicit-prelude #-} module Paths_StartStopFRP ( version, getBinDir, getLibDir, getDataDir, getLibexecDir, getDataFileName, getSysconfDir ) where import qualified Control.Exception as Exception import Data.V...
tylerwx51/StartStopFRP
dist/build/autogen/Paths_StartStopFRP.hs
bsd-3-clause
1,883
0
10
223
371
215
156
31
1
module Network.DNS.Pocket ( Port , runServer , setDomain , getDomain , deleteDomain , listDomain ) where --import Network.DNS.Pocket.Type import Network.DNS.Pocket.Server
junjihashimoto/pocket-dns
Network/DNS/Pocket.hs
bsd-3-clause
176
0
4
25
35
24
11
8
0
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 \section{SetLevels} *************************** Overview *************************** 1. We attach binding levels to Core bindings, in preparation for floating outwards (@FloatOut@). 2. We also let...
GaloisInc/halvm-ghc
compiler/simplCore/SetLevels.hs
bsd-3-clause
48,135
0
21
14,023
7,720
4,109
3,611
-1
-1
import System.Random (randomIO) import Data.Time.Clock (getCurrentTime, UTCTime) import Database.HDBC import Database.HDBC.PostgreSQL import Database.NySQL.TH import Database.NySQL.Options import Control.Monad import Control.Monad.Trans import Control.Exception import Control.Monad.Catch $(mkSqlWith (defOpts { paramM...
broma0/nysql
src/test/Example.hs
bsd-3-clause
1,052
0
11
241
281
160
121
-1
-1
-- | This module is meant to be imported qualified: -- -- @ -- import qualified Web.KISSmetrics as KISSmetrics -- @ module Web.KISSmetrics ( -- * Data types APIKey , SimpleText , Property , Timestamp(..) , generateTimestamp -- * Making calls , call , CallType(..) -- * Type ...
prowdsponsor/hissmetrics
src/Web/KISSmetrics.hs
bsd-3-clause
7,062
0
16
1,626
1,022
624
398
-1
-1
module Core.Compiler where import Control.Monad.Identity import Control.Monad.State import Core.Raw import Data.List (intercalate) import Data.Reify import qualified Core.Val as Ix frpValues :: Ix.FRP () -> IO (Graph Val) frpValues = fromIxValues . runIdentity . flip execStateT [] compiler :: Ix.FRP () -> IO String ...
sebastiaanvisser/frp-js
src/Core/Compiler.hs
bsd-3-clause
915
0
13
204
434
224
210
22
2
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ParallelListComp #-} module FillText (benchmark, summary) where import Control.Monad.Compat import qualified Data.Text as T import Data.Text (Text) import Graphics.Blank import Prelude.Compat ...
ku-fpg/blank-canvas-mark
hs/FillText.hs
bsd-3-clause
1,122
2
11
354
300
160
140
31
1
module Data.Intern ( Interned , InternSet , empty , singleton , insert , fromList , toList , delete , member , notMember ) where import qualified Data.Map as M type Cache a = M.Map a a type Interned a = a newtype InternSet a = InternSet { toCache :: Cache a } empty ...
thomaseding/intern
src/Data/Intern.hs
bsd-3-clause
1,293
0
12
351
575
307
268
39
2
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE FlexibleContexts #-} module Statistics.Distribution.Random.Exponential ( exponential ) where import Random.CRI import Statistics.Distribution.Random.Uniform -- q[k-1] = sum(log(2)^k / k!) k=1,..,n, q :: [Double] -- q = let factorial = foldr (*) 1 . enumFromTo 1 -- ...
finlay/random-dist
Statistics/Distribution/Random/Exponential.hs
bsd-3-clause
1,676
0
15
576
436
228
208
46
4
module System.Nemesis.DSL where import Control.Arrow ((>>>)) import Control.Lens import Control.Monad (when) import Data.List (sort, nub) import System.Directory (doesFileExist, doesDirectoryExist, removeFile, removeDirectoryRecursive) import System.Exit (ExitCode( ExitSuccess, ExitFailure), exitWith) import System.Fi...
nfjinjing/nemesis
src/System/Nemesis/DSL.hs
bsd-3-clause
1,939
0
18
535
653
344
309
57
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. module Duckling.AmountOfMoney.Tests ( tests ) where import Data.String import Prelude import Test.Tasty imp...
facebookincubator/duckling
tests/Duckling/AmountOfMoney/Tests.hs
bsd-3-clause
1,944
0
7
274
390
282
108
53
1
module Unification.TyContext where import qualified Data.Map as Map import Data.Map (Map) import Unification.Substitutable import Unification.Scheme newtype TyContext = TyContext (Map String Scheme) deriving (Monoid) instance Substitutable TyContext where apply s (TyContext env) = T...
letsbreelhere/egg
src/Unification/TyContext.hs
bsd-3-clause
850
0
9
160
308
166
142
19
1
{-# LANGUAGE DefaultSignatures , EmptyDataDecls , FunctionalDependencies , ScopedTypeVariables #-} module Rad.QL.Types ( OBJECT , INTERFACE , UNION , SCALAR , ENUM , GraphQLScalar(..) , GraphQLType(..) , GraphQLValue(..) -- utilities , resolveScalar ) where i...
jqyu/bustle-chi
src/Rad/QL/Types.hs
bsd-3-clause
7,424
0
12
1,782
2,009
1,063
946
-1
-1
{-# LANGUAGE CPP #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE BangPatterns #-} ----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.IndexUtils -- Copyright : (c) Duncan Coutts 2008 -- License : BSD-like -- -- Maintainer : duncan@communit...
martinvlk/cabal
cabal-install/Distribution/Client/IndexUtils.hs
bsd-3-clause
23,788
0
21
6,139
4,956
2,573
2,383
401
11
-------------------------------------------------------------------------- -- -- -- NfaMisc.hs -- -- -- -- Misecllaneous definitions for the NFA system. Includes -- -- examples of machines, and functions to print an NFA and the -- -- equivalence classes produces by minimisation. -- -- ...
AidanDelaney/Mira
src/Language/Mira/NfaMisc.hs
bsd-3-clause
2,791
46
16
665
732
401
331
47
1
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} -- | -- Module: $HEADER$ -- Description: Example of using @DerivingStrategies@ along with default -- HasVerbosity implementation based on generic-lens package. -- Copyright: (c) 2015-2019, Peter Tr...
trskop/verbosity
example/Example/ConfigGenericLens.hs
bsd-3-clause
801
0
8
157
86
58
28
12
0
{-# LANGUAGE TupleSections #-} module Main where import AdventOfCode import qualified Data.Set as S data TurnDirection = L | R data Instruction = Instruction { iDir :: TurnDirection , iBlocks :: Blocks } data Direction = N | E | S | W deriving (Show) type Blocks = Int data Position = Position...
purcell/adventofcode2016
src/Day1.hs
bsd-3-clause
2,021
0
11
501
795
422
373
72
3
{-# LANGUAGE MultiParamTypeClasses, RankNTypes, FunctionalDependencies #-} {-# LANGUAGE ConstraintKinds, UndecidableInstances #-} module FunDeps where ------------------------------------------------------------------------------ {- TEST 1: MultiParamTypeClass but NO functional dependencies -} class TCa a b where ...
dterei/Scraps
haskell/FunDeps.hs
bsd-3-clause
5,788
0
9
1,687
1,036
584
452
-1
-1
root = root
evolutics/haskell-formatter
testsuite/resources/source/terminates_file_with_newline/Output.hs
gpl-3.0
12
0
4
3
6
3
3
1
1
module ErrIndent where class X a where y :: a -> a class Y b where x :: b -> Int x _ = 2
roberth/uu-helium
test/typeClassesParse/ErrIndent.hs
gpl-3.0
110
1
8
46
49
25
24
-1
-1
{-# LANGUAGE DeriveGeneric , OverloadedStrings , RecordWildCards #-} module Docker.JSON.Types.Container where import Data.Aeson import Data.Default import qualified Data.Map as Map import Data.Maybe import qualified Data.Text as T import GHC.Generics --------------------------------------------------...
wayofthepie/docker-client
src/Docker/JSON/Types/Container.hs
bsd-3-clause
21,168
1
55
7,211
4,807
2,725
2,082
510
0
{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE NoMonomorphismRestriction #-} module T16976 where import Language.Haskell.TH (reifyType, runIO) import Language.Haskell.TH.Ppr (ppr_sig) import Data.Foldable (for_) import System.IO (hPrint, stderr) data T s = MkT1 | MkT2 aNumber = 5 aString = "hi" pattern P = MkT1 do...
sdiehl/ghc
testsuite/tests/th/T16976.hs
bsd-3-clause
1,131
0
13
369
204
122
82
-1
-1
import Control.Exception import Control.Monad (when) import qualified Data.ByteString.Char8 as B import Data.Loc import System.Environment (getArgs) import Text.PrettyPrint.Mainland import qualified Language.C.Parser as P import qualified Language.C.Parser.Tokens as T import qualified Language.C.Syntax as C import Lan...
flowbox-public/language-c-quote
examples/parse/Main.hs
bsd-3-clause
2,170
0
16
672
793
419
374
62
4
{-# LANGUAGE TypeFamilies #-} module T6018failclosed12 where -- This exposed a subtle bug in the implementation during development. After -- unifying the RHS of (1) and (2) the LHS substitution was done only in (2) -- which made it look like an overlapped equation. This is not the case and this -- definition should b...
acowley/ghc
testsuite/tests/typecheck/should_fail/T6018failclosed11.hs
bsd-3-clause
676
0
6
172
76
47
29
7
0
--- $Header$ module Language.Primitiv where import Language.Type import Autolib.Set import Power prim :: Language prim = Language { abbreviation = "{ 0,1 }^* - { w^k : w in {0,1}^*, k>1 }" , alphabet = mkSet "01" , contains = is_prim , sample = random_sample prim } is_prim :: String -> Bool is_pr...
Erdwolf/autotool-bonn
src/Language/Primitiv.hs
gpl-2.0
424
4
11
116
130
72
58
15
1
{-# LANGUAGE TemplateHaskell, GADTs, FlexibleInstances, ViewPatterns, CPP #-} -- | -- Module : Language.C.Inline.TH -- Copyright : 2014 Manuel M T Chakravarty -- License : BSD3 -- -- Maintainer : Manuel M T Chakravarty <chak@justtesting.org> -- Stability : experimental -- Portability : non-portable (GHC ...
beni55/language-c-inline
Language/C/Inline/TH.hs
bsd-3-clause
5,745
1
20
1,529
1,351
718
633
89
12
{-# LANGUAGE QuasiQuotes, BangPatterns, ScopedTypeVariables, TemplateHaskell, OverloadedStrings #-} {- The compactor does link-time optimization. It is much simpler than the Optimizer, no fancy dataflow analysis here. Optimizations: - rewrite all variables s...
manyoo/ghcjs
src/Gen2/Compactor.hs
mit
19,376
0
20
6,020
6,534
3,325
3,209
346
12
{-# LANGUAGE CPP, MagicHash #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.AttachInstances -- Copyright : (c) Simon Marlow 2006, -- David Waern 2006-2009, -- Isaac Dupree 2009 -- License : BSD-like...
adamse/haddock
haddock-api/src/Haddock/Interface/AttachInstances.hs
bsd-2-clause
9,235
109
23
2,330
2,484
1,338
1,146
161
6
{-# LANGUAGE GADTs, AllowAmbiguousTypes #-} module T8392a where -- Should complain even with AllowAmbiguousTypes -- -- But (#12466) we now don't complain about -- contradictory signatures -- Instead we get a redundant pattern-match warning, -- in the post-typechecking pattern-match checks foo :: (Int ~ Bool) => a -> a...
sdiehl/ghc
testsuite/tests/typecheck/should_fail/T8392a.hs
bsd-3-clause
331
0
7
54
39
25
14
4
1
module NameMapsPropDecorate where import NameMaps import TiPropDecorate --import PropSyntax(AssertionI,PredicateI) import NameMapsDecorate(mts) import TiTypes --import TiKinds import NameMapsProp() --import NameMapsPropStruct(bothtype,bothval) import HsIdent(mapHsIdent2) import MapDeclM --import MapDeclMBaseStruct() im...
forste/haReFork
tools/property/TI/NameMapsPropDecorate.hs
bsd-3-clause
2,930
0
13
590
1,276
645
631
-1
-1
-- | Extra Maybe utilities. module Data.Maybe.Extra where import Control.Monad import Data.Maybe -- | Monadic 'mapMaybe'. mapMaybeM :: Monad f => (a -> f (Maybe b)) -> [a] -> f [b] mapMaybeM f = liftM catMaybes . mapM f
mathhun/stack
src/Data/Maybe/Extra.hs
bsd-3-clause
223
0
11
42
82
44
38
5
1
{-# LANGUAGE GeneralizedNewtypeDeriving #-} module Orville.PostgreSQL.Internal.Expr.TableDefinition ( CreateTableExpr, createTableExpr, PrimaryKeyExpr, primaryKeyExpr, AlterTableExpr, alterTableExpr, AlterTableAction, addColumn, dropColumn, addConstraint, dropConstraint, a...
flipstone/orville
orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/Expr/TableDefinition.hs
mit
5,986
0
14
1,208
1,231
653
578
180
2
module Haskeroids.Initialize where import Graphics.Rendering.OpenGL import Graphics.UI.GLUT import Haskeroids.Callbacks -- | Set up the main application window initializeWindow = do _ <- getArgsAndInitialize initialWindowSize $= Size 800 600 initialDisplayMode $= [DoubleBuffered] createWindow "Haske...
shangaslammi/haskeroids
Haskeroids/Initialize.hs
mit
1,154
0
10
268
238
117
121
26
1
{-# OPTIONS_GHC -fno-warn-type-defaults #-} import Data.Foldable (for_) import Test.Hspec (Spec, describe, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Say (inEnglish) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs specs :: Spec spec...
exercism/xhaskell
exercises/practice/say/test/Tests.hs
mit
2,217
0
10
1,102
339
197
142
27
1
module Lesson2.UCS.Enumerator where import Control.Monad.Trans (MonadIO, liftIO) import Data.Lens.Common (getL) import Data.Enumerator ( Stream(..) , Step(..) , Iteratee(..) , Enumerator , (>>==) , returnI , continue , yield ) import Data.Hashable (Hashable(..)) import Data.Maybe (fromJust) import ...
roman/ai-class-haskell
src/Lesson2/UCS/Enumerator.hs
mit
1,056
0
13
271
321
179
142
35
1
import Primes import Utils lengthGreater3 :: [a] -> Bool lengthGreater3 (a:b:c:d:xs) = True lengthGreater3 _ = False morethanFourFactors = lengthGreater3 . primeFactors pairs = map (\n -> (n,morethanFourFactors n)) [2..] firstFourTrue :: [(Integer, Bool)] -> Integer firstFourTrue ((n1,b1):(n2,b2):(n3,b3):(n4,b4):xs...
arekfu/project_euler
p0047/p0047.hs
mit
475
0
11
84
241
133
108
13
1
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-} module Leankit.Types.Card where import Control.Applicative ((<$>)) import Data.Aeson import Data.Aeson.TH import Data.List.Split import Leankit.Types.TH import Leankit.Types.Common import Leankit.Types.AssignedUser (AssignedUser) import Leankit.Types.CardContext (...
dtorok/leankit-hsapi
Leankit/Types/Card.hs
mit
3,555
0
10
1,576
648
367
281
70
0