Search is not available for this dataset
repo_name
string
path
string
license
string
full_code
string
full_size
int64
uncommented_code
string
uncommented_size
int64
function_only_code
string
function_only_size
int64
is_commented
bool
is_signatured
bool
n_ast_errors
int64
ast_max_depth
int64
n_whitespaces
int64
n_ast_nodes
int64
n_ast_terminals
int64
n_ast_nonterminals
int64
loc
int64
cycloplexity
int64
aurapm/haskell-versions
test/Test.hs
bsd-3-clause
-- | Cabal makes this distinction: 0.2 < 0.2.0 < 0.2.0.0 -- Apparently there are only 5 packages on Hackage that actually -- make this necessary, meaning `cabal` can't be simplified to ignore it. -- Logically, these are the same package, but for those 5 packages, they -- aren't. cabalOrd :: [T.Text] cabalOrd = [ "0", "...
346
cabalOrd :: [T.Text] cabalOrd = [ "0", "0.2", "0.2.0", "0.2.0.0" ]
66
cabalOrd = [ "0", "0.2", "0.2.0", "0.2.0.0" ]
45
true
true
0
8
59
40
23
17
null
null
junjihashimoto/persistent
persistent/Database/Persist/Class/PersistField.hs
mit
getPersistMap (PersistText t) = getPersistMap (PersistByteString $ TE.encodeUtf8 t)
84
getPersistMap (PersistText t) = getPersistMap (PersistByteString $ TE.encodeUtf8 t)
84
getPersistMap (PersistText t) = getPersistMap (PersistByteString $ TE.encodeUtf8 t)
84
false
false
0
9
9
30
14
16
null
null
OS2World/DEV-UTIL-HUGS
libraries/Graphics/Rendering/OpenGL/GL/VertexArrays.hs
bsd-3-clause
getFogCoordPointer :: IO (DataType, Stride, Ptr a) getFogCoordPointer = do d <- getEnum1 unmarshalDataType GetFogCoordinateArrayType s <- getInteger1 fromIntegral GetFogCoordinateArrayStride p <- getPointer FogCoordinateArrayPointer return (d, s, p)
261
getFogCoordPointer :: IO (DataType, Stride, Ptr a) getFogCoordPointer = do d <- getEnum1 unmarshalDataType GetFogCoordinateArrayType s <- getInteger1 fromIntegral GetFogCoordinateArrayStride p <- getPointer FogCoordinateArrayPointer return (d, s, p)
261
getFogCoordPointer = do d <- getEnum1 unmarshalDataType GetFogCoordinateArrayType s <- getInteger1 fromIntegral GetFogCoordinateArrayStride p <- getPointer FogCoordinateArrayPointer return (d, s, p)
210
false
true
0
8
39
75
36
39
null
null
micknelso/language-c
src/Language/CFamily/CXX/DefTable.hs
bsd-3-clause
-- | Merge two DefTables. If both tables contain an entry for a given -- key, they must agree on its value. mergeDefTable :: DefTable -> DefTable -> DefTable mergeDefTable (DefTable i1 t1 l1 m1 r1 tt1) (DefTable i2 t2 l2 m2 r2 tt2) = DefTable (mergeNameSpace i1 i2) (mergeNameSpace t1 t2) (mergeNameSpace l1 l2...
380
mergeDefTable :: DefTable -> DefTable -> DefTable mergeDefTable (DefTable i1 t1 l1 m1 r1 tt1) (DefTable i2 t2 l2 m2 r2 tt2) = DefTable (mergeNameSpace i1 i2) (mergeNameSpace t1 t2) (mergeNameSpace l1 l2) (mergeNameSpace m1 m2) (union r1 r2) (union tt1 tt2)
270
mergeDefTable (DefTable i1 t1 l1 m1 r1 tt1) (DefTable i2 t2 l2 m2 r2 tt2) = DefTable (mergeNameSpace i1 i2) (mergeNameSpace t1 t2) (mergeNameSpace l1 l2) (mergeNameSpace m1 m2) (union r1 r2) (union tt1 tt2)
220
true
true
0
7
79
124
60
64
null
null
izgzhen/hadrian
src/Settings/Builders/Ghc.hs
mit
ghcCbuilderArgs :: Args ghcCbuilderArgs = builder (Ghc CompileCWithGhc) ? do way <- getWay let ccArgs = [ getPkgDataList CcArgs , getStagedSettingList ConfCcArgs , cIncludeArgs , arg "-Werror" , Dynamic `wayUnit` way ? pure [ "-fPIC", "-DDYNA...
571
ghcCbuilderArgs :: Args ghcCbuilderArgs = builder (Ghc CompileCWithGhc) ? do way <- getWay let ccArgs = [ getPkgDataList CcArgs , getStagedSettingList ConfCcArgs , cIncludeArgs , arg "-Werror" , Dynamic `wayUnit` way ? pure [ "-fPIC", "-DDYNA...
571
ghcCbuilderArgs = builder (Ghc CompileCWithGhc) ? do way <- getWay let ccArgs = [ getPkgDataList CcArgs , getStagedSettingList ConfCcArgs , cIncludeArgs , arg "-Werror" , Dynamic `wayUnit` way ? pure [ "-fPIC", "-DDYNAMIC" ] ] mconcat [ ...
547
false
true
0
15
233
148
78
70
null
null
CulpaBS/wbBach
src/Futhark/Optimise/Simplifier/RuleM.hs
bsd-3-clause
cannotSimplify :: Monad m => RuleM m a cannotSimplify = fail "Cannot simplify"
78
cannotSimplify :: Monad m => RuleM m a cannotSimplify = fail "Cannot simplify"
78
cannotSimplify = fail "Cannot simplify"
39
false
true
0
6
12
26
12
14
null
null
mettekou/ghc
compiler/prelude/THNames.hs
bsd-3-clause
listTName = libFun (fsLit "listT") listTIdKey
64
listTName = libFun (fsLit "listT") listTIdKey
64
listTName = libFun (fsLit "listT") listTIdKey
64
false
false
0
7
24
17
8
9
null
null
robdockins/edison
edison-core/src/Data/Edison/Assoc/TernaryTrie.hs
mit
addToFMB nk@(x:xs) combiner (I size k v l m@(FMB' fmbm) r) = case compare x k of LT -> mkBalancedFMB k v (addToFMB nk combiner l) m r GT -> mkBalancedFMB k v l m (addToFMB nk combiner r) EQ -> case xs of [] -> I size k (combiner v) l m r _ -> I size k v l (FMB'...
351
addToFMB nk@(x:xs) combiner (I size k v l m@(FMB' fmbm) r) = case compare x k of LT -> mkBalancedFMB k v (addToFMB nk combiner l) m r GT -> mkBalancedFMB k v l m (addToFMB nk combiner r) EQ -> case xs of [] -> I size k (combiner v) l m r _ -> I size k v l (FMB'...
351
addToFMB nk@(x:xs) combiner (I size k v l m@(FMB' fmbm) r) = case compare x k of LT -> mkBalancedFMB k v (addToFMB nk combiner l) m r GT -> mkBalancedFMB k v l m (addToFMB nk combiner r) EQ -> case xs of [] -> I size k (combiner v) l m r _ -> I size k v l (FMB'...
351
false
false
0
14
126
181
89
92
null
null
leksah/yi
src/library/Yi/Syntax/Haskell.hs
gpl-2.0
-- | Parse a endBlock token endBlock :: Token endBlock = Special '>'
68
endBlock :: Token endBlock = Special '>'
40
endBlock = Special '>'
22
true
true
0
6
12
22
9
13
null
null
plow-technologies/persistent
persistent-mysql/Database/Persist/MySQL.hs
mit
-- | Create a MySQL connection pool. Note that it's your -- responsibility to properly close the connection pool when -- unneeded. Use 'withMySQLPool' for automatic resource control. createMySQLPool :: (MonadUnliftIO m, MonadLogger m, IsSqlBackend backend) => MySQL.ConnectInfo -- ^ Con...
517
createMySQLPool :: (MonadUnliftIO m, MonadLogger m, IsSqlBackend backend) => MySQL.ConnectInfo -- ^ Connection information. -> Int -- ^ Number of connections to be kept open in the pool. -> m (Pool backend) createMySQLPool ci = createSqlPoo...
332
createMySQLPool ci = createSqlPool $ open' ci
45
true
true
0
10
148
66
35
31
null
null
lynnard/cocos2d-proj
src/Main.hs
mit
boxThrower :: (NodeGraph t m, PrimMonad m) => Gen (PrimState m) -> V2 Double -> Event t (DragEvent t) -> Event t NominalDiffTime -> FreeT (Event t) m String boxThrower gen winSize@(V2 sw sh) drags ts = do lift $ askPostBuildEvent >>= runEvent_ . (liftIO (putStrLn "second ...
1,867
boxThrower :: (NodeGraph t m, PrimMonad m) => Gen (PrimState m) -> V2 Double -> Event t (DragEvent t) -> Event t NominalDiffTime -> FreeT (Event t) m String boxThrower gen winSize@(V2 sw sh) drags ts = do lift $ askPostBuildEvent >>= runEvent_ . (liftIO (putStrLn "second ...
1,867
boxThrower gen winSize@(V2 sw sh) drags ts = do lift $ askPostBuildEvent >>= runEvent_ . (liftIO (putStrLn "second scene built") <$) let midP = (0 .+^ winSize/2) boxImage = "res/box.png" enemyFns = [ "res/walk/000"++show i++".png" | i <- [1..8]::[Int] ] -- Scene 1 loadingScene midP $ box...
1,666
false
true
0
17
728
615
306
309
null
null
patrickherrmann/hearts
src/Hearts.hs
mit
progressRound :: Validator -> RoundState -> HeartsIO RoundState progressRound vf rs = do let p = toPlay rs c <- doPlayerIO p chooseCard (getRoundStateView rs p) let mErr = vf rs c case mErr of Just err -> do doPlayerIO p showMoveInfraction err progressRound vf rs Nothing -> do let rs'...
432
progressRound :: Validator -> RoundState -> HeartsIO RoundState progressRound vf rs = do let p = toPlay rs c <- doPlayerIO p chooseCard (getRoundStateView rs p) let mErr = vf rs c case mErr of Just err -> do doPlayerIO p showMoveInfraction err progressRound vf rs Nothing -> do let rs'...
432
progressRound vf rs = do let p = toPlay rs c <- doPlayerIO p chooseCard (getRoundStateView rs p) let mErr = vf rs c case mErr of Just err -> do doPlayerIO p showMoveInfraction err progressRound vf rs Nothing -> do let rs' = unsafePlayCard rs (toPlay rs) c doEachPlayerIO_ showRou...
368
false
true
5
10
109
143
69
74
null
null
reinerp/hmatrix-static
Numeric/LinearAlgebra/Static/Algorithms.hs
gpl-3.0
inv :: (H.Field t) => Matrix (m,m) t -> Matrix (m,m) t inv = Matrix . H.inv . unMatrix
86
inv :: (H.Field t) => Matrix (m,m) t -> Matrix (m,m) t inv = Matrix . H.inv . unMatrix
86
inv = Matrix . H.inv . unMatrix
31
false
true
0
9
18
64
32
32
null
null
michalkonecny/aern2
aern2-fun-univariate/src/AERN2/PPoly/Tests.hs
bsd-3-clause
basicFunctions :: (DyadicInterval, Accuracy) -> [(Frequency, PPoly)] basicFunctions domAcc = [(10,x), (1, c 0.5), (1, c 2), (1, c 100), (1, c (0.5^!20))] where x = fromPoly $ varFn domAcc () c :: (CanBeDyadic t) => t -> PPoly c n = fromPoly $ constFn domAcc (dyadic n)
276
basicFunctions :: (DyadicInterval, Accuracy) -> [(Frequency, PPoly)] basicFunctions domAcc = [(10,x), (1, c 0.5), (1, c 2), (1, c 100), (1, c (0.5^!20))] where x = fromPoly $ varFn domAcc () c :: (CanBeDyadic t) => t -> PPoly c n = fromPoly $ constFn domAcc (dyadic n)
276
basicFunctions domAcc = [(10,x), (1, c 0.5), (1, c 2), (1, c 100), (1, c (0.5^!20))] where x = fromPoly $ varFn domAcc () c :: (CanBeDyadic t) => t -> PPoly c n = fromPoly $ constFn domAcc (dyadic n)
207
false
true
0
9
55
157
87
70
null
null
mainland/dph
dph-prim-par/Data/Array/Parallel/Unlifted.hs
bsd-3-clause
-- Random arrays -------------------------------------------------------------- randoms = Seq.random
124
randoms = Seq.random
44
randoms = Seq.random
44
true
false
0
5
30
9
5
4
null
null
pavelfatin/haskell-blocks
src/Cluster.hs
gpl-3.0
centerClusterAtLocation :: Location -> Cluster -> Cluster centerClusterAtLocation (Location x0 y0) cluster@(Cluster blocks) = let (Location x1 y1) = centerLocationOfCluster cluster dx = x1 - x0 dy = y1 - y0 transformation = \(Location x y) -> Location (x - dx) (y - dy) in Cluster $ M...
352
centerClusterAtLocation :: Location -> Cluster -> Cluster centerClusterAtLocation (Location x0 y0) cluster@(Cluster blocks) = let (Location x1 y1) = centerLocationOfCluster cluster dx = x1 - x0 dy = y1 - y0 transformation = \(Location x y) -> Location (x - dx) (y - dy) in Cluster $ M...
352
centerClusterAtLocation (Location x0 y0) cluster@(Cluster blocks) = let (Location x1 y1) = centerLocationOfCluster cluster dx = x1 - x0 dy = y1 - y0 transformation = \(Location x y) -> Location (x - dx) (y - dy) in Cluster $ Map.mapKeys transformation blocks
294
false
true
0
12
85
130
66
64
null
null
qnikst/cgroups-hs
System/Linux/Cgroups/Subsystem/Devices.hs
bsd-3-clause
subDevices = Controller "devices"
33
subDevices = Controller "devices"
33
subDevices = Controller "devices"
33
false
false
0
5
3
9
4
5
null
null
geophf/1HaskellADay
exercises/HAD/Rosalind/AminoAcid.hs
mit
code2Maybe Stop = Nothing
25
code2Maybe Stop = Nothing
25
code2Maybe Stop = Nothing
25
false
false
1
5
3
13
4
9
null
null
beni55/alex
src/Data/Ranged/Ranges.hs
bsd-3-clause
prop_intSingleton :: Integer -> Integer -> Property prop_intSingleton x y = forAll (rangeAround x y) $ \r -> case filter (rangeHas r) [x-1 .. y+1] of [v] -> rangeSingletonValue r == Just v _ -> rangeSingletonValue r == Nothing where ...
452
prop_intSingleton :: Integer -> Integer -> Property prop_intSingleton x y = forAll (rangeAround x y) $ \r -> case filter (rangeHas r) [x-1 .. y+1] of [v] -> rangeSingletonValue r == Just v _ -> rangeSingletonValue r == Nothing where ...
452
prop_intSingleton x y = forAll (rangeAround x y) $ \r -> case filter (rangeHas r) [x-1 .. y+1] of [v] -> rangeSingletonValue r == Just v _ -> rangeSingletonValue r == Nothing where rangeAround v1 v2 = return Range `ap` genBound v1...
400
false
true
0
11
155
162
80
82
null
null
urbanslug/ghc
testsuite/tests/gadt/T2040.hs
bsd-3-clause
foo2 :: W (S ()) -> W (S ()) -> () foo2 (W (_ :: W a1)) (W (_ :: W a2)) = case proof :: Teq a1 (S ()) of Teq -> case proof :: Teq a2 (S ()) of Teq -> ()
172
foo2 :: W (S ()) -> W (S ()) -> () foo2 (W (_ :: W a1)) (W (_ :: W a2)) = case proof :: Teq a1 (S ()) of Teq -> case proof :: Teq a2 (S ()) of Teq -> ()
172
foo2 (W (_ :: W a1)) (W (_ :: W a2)) = case proof :: Teq a1 (S ()) of Teq -> case proof :: Teq a2 (S ()) of Teq -> ()
137
false
true
0
13
63
138
67
71
null
null
wavewave/LHCOAnalysis
trash/Cuts.hs
bsd-3-clause
numbjet :: PhyEventClassified -> Maybe Double numbjet = Just . fromIntegral . Prelude.length . bjetlst
103
numbjet :: PhyEventClassified -> Maybe Double numbjet = Just . fromIntegral . Prelude.length . bjetlst
102
numbjet = Just . fromIntegral . Prelude.length . bjetlst
56
false
true
1
7
15
39
17
22
null
null
versusvoid/blaise
src/Parser.hs
mit
repeatStatement :: Parser Statement repeatStatement = do reserved "repeat" body <- statementOrStatements reserved "until" cond <- booleanExpression return $! Repeat body cond
194
repeatStatement :: Parser Statement repeatStatement = do reserved "repeat" body <- statementOrStatements reserved "until" cond <- booleanExpression return $! Repeat body cond
194
repeatStatement = do reserved "repeat" body <- statementOrStatements reserved "until" cond <- booleanExpression return $! Repeat body cond
158
false
true
0
8
41
52
22
30
null
null
jystic/QuickSpec
qs1/CongruenceClosure.hs
bsd-3-clause
lookup2 :: Int -> Int -> IntMap (IntMap a) -> Maybe a lookup2 k1 k2 m = IntMap.lookup k2 (IntMap.findWithDefault IntMap.empty k1 m)
131
lookup2 :: Int -> Int -> IntMap (IntMap a) -> Maybe a lookup2 k1 k2 m = IntMap.lookup k2 (IntMap.findWithDefault IntMap.empty k1 m)
131
lookup2 k1 k2 m = IntMap.lookup k2 (IntMap.findWithDefault IntMap.empty k1 m)
77
false
true
0
10
22
63
30
33
null
null
spinningfire/aikatsu
test/Spec.hs
bsd-3-clause
photoOtome = Photo "Arisugawa Otome" Otome 60 1400 "Pop Flash" 7800 R Pop 45 (AppealUp 15) HappyRainbow
103
photoOtome = Photo "Arisugawa Otome" Otome 60 1400 "Pop Flash" 7800 R Pop 45 (AppealUp 15) HappyRainbow
103
photoOtome = Photo "Arisugawa Otome" Otome 60 1400 "Pop Flash" 7800 R Pop 45 (AppealUp 15) HappyRainbow
103
false
false
1
7
16
39
17
22
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/cabal-install/Distribution/Client/PlanIndex.hs
bsd-3-clause
-- | Given a package index where we assume we want to use all the packages -- (use 'dependencyClosure' if you need to get such a index subset) find out -- if the dependencies within it use consistent versions of each package. -- Return all cases where multiple packages depend on different versions of -- some other pack...
2,890
dependencyInconsistencies' :: forall pkg. (PackageFixedDeps pkg, HasUnitId pkg) => FakeMap -> PackageIndex pkg -> [(PackageName, [(PackageIdentifier, Version)])] dependencyInconsistencies' fakeMap index = ...
2,395
dependencyInconsistencies' fakeMap index = [ (name, [ (pid,packageVersion dep) | (dep,pids) <- uses, pid <- pids]) | (name, ipid_map) <- Map.toList inverseIndex , let uses = Map.elems ipid_map , reallyIsInconsistent (map fst uses) ] where -- For each package name (of a dependency, somewhere) ...
2,122
true
true
0
13
718
496
277
219
null
null
GaloisInc/gidl
src/Gidl/Backend/Haskell/Types.hs
bsd-3-clause
-- | Produce a FromJSON instance. -- -- NOTE: this instance relies on a GHC that supports Generics. fromJSONInstance :: TypeName -> Doc fromJSONInstance tname = nest 2 (text "instance FromJSON" <+> text tname)
209
fromJSONInstance :: TypeName -> Doc fromJSONInstance tname = nest 2 (text "instance FromJSON" <+> text tname)
109
fromJSONInstance tname = nest 2 (text "instance FromJSON" <+> text tname)
73
true
true
0
8
33
39
20
19
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/Enums.hs
mit
js_RequestCacheNoCache = "no-cache"
35
js_RequestCacheNoCache = "no-cache"
35
js_RequestCacheNoCache = "no-cache"
35
false
false
0
4
2
6
3
3
null
null
8l/barrelfish
tools/flounder/MsgFragments.hs
mit
bitsizeof_builtin _ Bool = 1
28
bitsizeof_builtin _ Bool = 1
28
bitsizeof_builtin _ Bool = 1
28
false
false
1
5
4
13
5
8
null
null
x-y-z/cabal
cabal-install/Distribution/Client/Init.hs
bsd-3-clause
-- | Write a main file if it doesn't already exist. writeMainHs :: InitFlags -> FilePath -> IO () writeMainHs flags mainPath = do dir <- maybe getCurrentDirectory return (flagToMaybe $ packageDir flags) let mainFullPath = dir </> mainPath exists <- doesFileExist mainFullPath unless exists $ do message fla...
463
writeMainHs :: InitFlags -> FilePath -> IO () writeMainHs flags mainPath = do dir <- maybe getCurrentDirectory return (flagToMaybe $ packageDir flags) let mainFullPath = dir </> mainPath exists <- doesFileExist mainFullPath unless exists $ do message flags $ "Generating " ++ mainPath ++ "..." writeF...
411
writeMainHs flags mainPath = do dir <- maybe getCurrentDirectory return (flagToMaybe $ packageDir flags) let mainFullPath = dir </> mainPath exists <- doesFileExist mainFullPath unless exists $ do message flags $ "Generating " ++ mainPath ++ "..." writeFileSafe flags mainFullPath mainHs -- | Defaul...
365
true
true
0
14
91
121
54
67
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/paper/haroldcarr/2014-02-28-using-graphviz-via-haskell/e1.hs
unlicense
mapShowDot :: (Show (gr l el), Graph gr) => [(String, gr l el)] -> IO () mapShowDot xs = forM_ xs showDot
105
mapShowDot :: (Show (gr l el), Graph gr) => [(String, gr l el)] -> IO () mapShowDot xs = forM_ xs showDot
105
mapShowDot xs = forM_ xs showDot
32
false
true
0
10
21
69
34
35
null
null
adnelson/Idris-dev
src/Idris/Elab/Value.hs
bsd-3-clause
elabDocTerms :: ElabInfo -> Docstring (Either Err PTerm) -> Idris (Docstring DocTerm) elabDocTerms info str = do typechecked <- Traversable.mapM decorate str return $ checkDocstring mkDocTerm typechecked where decorate (Left err) = return (Left err) decorate (Right pt) = fmap (fmap ...
1,260
elabDocTerms :: ElabInfo -> Docstring (Either Err PTerm) -> Idris (Docstring DocTerm) elabDocTerms info str = do typechecked <- Traversable.mapM decorate str return $ checkDocstring mkDocTerm typechecked where decorate (Left err) = return (Left err) decorate (Right pt) = fmap (fmap ...
1,260
elabDocTerms info str = do typechecked <- Traversable.mapM decorate str return $ checkDocstring mkDocTerm typechecked where decorate (Left err) = return (Left err) decorate (Right pt) = fmap (fmap fst) (tryElabVal info ERHS pt) tryElabVal :: ElabInfo -> ElabMode -> PTerm ->...
1,174
false
true
2
11
444
371
175
196
null
null
mathk/arm-isa
ElfParser.hs
mit
parseSectionHeader :: ParseElf ELFSectionHeader parseSectionHeader = do shn <- F.parseWord sht <- parseSectionHeaderType shflgs <- parseMachineDepWord sha <- parseMachineDepWord sho <- parseMachineDepWord shs <- parseMachineDepWord shl <- F.parseWord shi <- F.parseWord ...
555
parseSectionHeader :: ParseElf ELFSectionHeader parseSectionHeader = do shn <- F.parseWord sht <- parseSectionHeaderType shflgs <- parseMachineDepWord sha <- parseMachineDepWord sho <- parseMachineDepWord shs <- parseMachineDepWord shl <- F.parseWord shi <- F.parseWord ...
554
parseSectionHeader = do shn <- F.parseWord sht <- parseSectionHeaderType shflgs <- parseMachineDepWord sha <- parseMachineDepWord sho <- parseMachineDepWord shs <- parseMachineDepWord shl <- F.parseWord shi <- F.parseWord shaa <- parseMachineDepWord shes <- pa...
506
false
true
0
10
115
164
84
80
null
null
lessandro/contas
src/Contas/Httpd.hs
mit
-- Keep reading lines until "\r" is found readUntilCR :: Handle -> IO () readUntilCR h = do line <- readLine h case line of "\r" -> return () "" -> return () _ -> readUntilCR h -- Read and decode things like "GET / HTTP/1.0\r"
259
readUntilCR :: Handle -> IO () readUntilCR h = do line <- readLine h case line of "\r" -> return () "" -> return () _ -> readUntilCR h -- Read and decode things like "GET / HTTP/1.0\r"
217
readUntilCR h = do line <- readLine h case line of "\r" -> return () "" -> return () _ -> readUntilCR h -- Read and decode things like "GET / HTTP/1.0\r"
186
true
true
0
11
78
73
34
39
null
null
ennocramer/hindent
src/HIndent/Styles/JohanTibell.hs
bsd-3-clause
exp (Tuple _ boxed exps) = depend (write (case boxed of Unboxed -> "(#" Boxed -> "(")) (do single <- isSingleLiner p underflow <- fmap not (isOverflow p) if single && underflow then p else prefixedLined "," ...
564
exp (Tuple _ boxed exps) = depend (write (case boxed of Unboxed -> "(#" Boxed -> "(")) (do single <- isSingleLiner p underflow <- fmap not (isOverflow p) if single && underflow then p else prefixedLined "," ...
564
exp (Tuple _ boxed exps) = depend (write (case boxed of Unboxed -> "(#" Boxed -> "(")) (do single <- isSingleLiner p underflow <- fmap not (isOverflow p) if single && underflow then p else prefixedLined "," ...
564
false
false
1
14
268
176
83
93
null
null
chadbrewbaker/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
checkList l t = concatMap (\f -> f t) l
39
checkList l t = concatMap (\f -> f t) l
39
checkList l t = concatMap (\f -> f t) l
39
false
false
0
8
9
27
13
14
null
null
LeoMingo/RPNMathParser
Functions/InfixOperations.hs
gpl-3.0
--Infix Variable Operation Check --examples like: 5 x1 * , a b - infVCheck :: String -> String -> Bool infVCheck a b | isVariable a && isVariable b = True | isVariable a && (isConstant b || isBlock b) = True | isVariable b && (isConstant a || isBlock a) = True | otherwise = Fa...
323
infVCheck :: String -> String -> Bool infVCheck a b | isVariable a && isVariable b = True | isVariable a && (isConstant b || isBlock b) = True | isVariable b && (isConstant a || isBlock a) = True | otherwise = False
257
infVCheck a b | isVariable a && isVariable b = True | isVariable a && (isConstant b || isBlock b) = True | isVariable b && (isConstant a || isBlock a) = True | otherwise = False
219
true
true
0
11
99
109
50
59
null
null
noteed/concepted
Concepted/Core.hs
bsd-3-clause
lineEditor _ _ = return Ignored
31
lineEditor _ _ = return Ignored
31
lineEditor _ _ = return Ignored
31
false
false
0
5
5
14
6
8
null
null
open-etcs/openetcs-dmi
src/ETCS/DMI/Helpers.hs
bsd-3-clause
_createSVGTextElement :: (MonadIO m, IsDocument self) => self -> m SVGTextElement _createSVGTextElement doc = _createElementNS doc svgNS "text" castToSVGTextElement
164
_createSVGTextElement :: (MonadIO m, IsDocument self) => self -> m SVGTextElement _createSVGTextElement doc = _createElementNS doc svgNS "text" castToSVGTextElement
164
_createSVGTextElement doc = _createElementNS doc svgNS "text" castToSVGTextElement
82
false
true
0
7
18
45
22
23
null
null
exclipy/pdata
Data/BitUtil.hs
bsd-3-clause
bitCount8 22 = 3
16
bitCount8 22 = 3
16
bitCount8 22 = 3
16
false
false
0
5
3
9
4
5
null
null
elieux/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
alternativeClassName = clsQual mONAD (fsLit "Alternative") alternativeClassKey
78
alternativeClassName = clsQual mONAD (fsLit "Alternative") alternativeClassKey
78
alternativeClassName = clsQual mONAD (fsLit "Alternative") alternativeClassKey
78
false
false
0
7
6
19
9
10
null
null
substack/hs-disappoint
src/Language/Haskell/Pointfree/PrettyPrinter.hs
mit
toSExpr (Let ds e) = SLet ds $ toSExpr e
40
toSExpr (Let ds e) = SLet ds $ toSExpr e
40
toSExpr (Let ds e) = SLet ds $ toSExpr e
40
false
false
2
6
9
30
12
18
null
null
DavidAlphaFox/darcs
src/Darcs/Repository/HashedRepo.hs
gpl-2.0
readInventoryPrivate :: String -> String -> IO (Maybe String, [(PatchInfo, String)]) readInventoryPrivate dir invName = do inv <- skipPristine <$> gzFetchFilePS (dir </> invName) Uncachable readInventoryFromContent (toPath dir ++ "/" ++ darcsdir ++ invName) inv -- |readInventoryFromContent...
410
readInventoryPrivate :: String -> String -> IO (Maybe String, [(PatchInfo, String)]) readInventoryPrivate dir invName = do inv <- skipPristine <$> gzFetchFilePS (dir </> invName) Uncachable readInventoryFromContent (toPath dir ++ "/" ++ darcsdir ++ invName) inv -- |readInventoryFromContent...
410
readInventoryPrivate dir invName = do inv <- skipPristine <$> gzFetchFilePS (dir </> invName) Uncachable readInventoryFromContent (toPath dir ++ "/" ++ darcsdir ++ invName) inv -- |readInventoryFromContent extracts an inventory from the content of an -- inventory file, who's path is @fileName@.
304
false
true
0
13
81
101
50
51
null
null
avh4/elm-format
elm-format-test-lib/test/Data/FileTreeTest.hs
bsd-3-clause
spec_spec :: Spec spec_spec = describe "Data.FileTree" $ do it "can read and write a file" $ do (mempty :: FileTree Text) |> FileTree.write "/file.txt" "{}" |> FileTree.read "/file.txt" |> flip shouldBe (Just "{}") it "can read a non-exist...
2,655
spec_spec :: Spec spec_spec = describe "Data.FileTree" $ do it "can read and write a file" $ do (mempty :: FileTree Text) |> FileTree.write "/file.txt" "{}" |> FileTree.read "/file.txt" |> flip shouldBe (Just "{}") it "can read a non-exist...
2,655
spec_spec = describe "Data.FileTree" $ do it "can read and write a file" $ do (mempty :: FileTree Text) |> FileTree.write "/file.txt" "{}" |> FileTree.read "/file.txt" |> flip shouldBe (Just "{}") it "can read a non-existent file" $ do ...
2,637
false
true
0
19
1,141
608
274
334
null
null
crockeo/ballgame
src/Position.hs
mit
scalar :: Position -> Int -> Position scalar (x1, y1) n = (x1 * n, y1 * n)
74
scalar :: Position -> Int -> Position scalar (x1, y1) n = (x1 * n, y1 * n)
74
scalar (x1, y1) n = (x1 * n, y1 * n)
36
false
true
0
6
17
44
24
20
null
null
oldmanmike/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
hsExprNeedsParens (HsRnBracketOut {}) = False
45
hsExprNeedsParens (HsRnBracketOut {}) = False
45
hsExprNeedsParens (HsRnBracketOut {}) = False
45
false
false
0
7
4
16
8
8
null
null
vikraman/ghc
compiler/types/Type.hs
bsd-3-clause
mkNamedBinder :: VisibilityFlag -> Var -> TyBinder mkNamedBinder vis var = Named var vis
88
mkNamedBinder :: VisibilityFlag -> Var -> TyBinder mkNamedBinder vis var = Named var vis
88
mkNamedBinder vis var = Named var vis
37
false
true
0
8
13
36
15
21
null
null
todays-mitsui/discussion
src/Discussion/Converter.hs
mit
unlambda (Lambda vs t) = unabstract vs t
40
unlambda (Lambda vs t) = unabstract vs t
40
unlambda (Lambda vs t) = unabstract vs t
40
false
false
0
7
7
22
10
12
null
null
DavidAlphaFox/ghc
libraries/Cabal/Cabal/Distribution/Simple/BuildTarget.hs
bsd-3-clause
pkgComponentInfo :: PackageDescription -> [ComponentInfo] pkgComponentInfo pkg = [ ComponentInfo { cinfoName = componentName c, cinfoStrName = componentStringName pkg (componentName c), cinfoSrcDirs = hsSourceDirs bi, cinfoModules = componentModules c, cinfoHsFiles = compo...
481
pkgComponentInfo :: PackageDescription -> [ComponentInfo] pkgComponentInfo pkg = [ ComponentInfo { cinfoName = componentName c, cinfoStrName = componentStringName pkg (componentName c), cinfoSrcDirs = hsSourceDirs bi, cinfoModules = componentModules c, cinfoHsFiles = compo...
481
pkgComponentInfo pkg = [ ComponentInfo { cinfoName = componentName c, cinfoStrName = componentStringName pkg (componentName c), cinfoSrcDirs = hsSourceDirs bi, cinfoModules = componentModules c, cinfoHsFiles = componentHsFiles c, cinfoCFiles = cSources bi, ...
423
false
true
0
11
131
127
65
62
null
null
peter-fogg/pardoc
src/Text/Pandoc/Writers/Docbook.hs
gpl-2.0
-- | Convert a list of Pandoc blocks to Docbook. blocksToDocbook :: WriterOptions -> [Block] -> Doc blocksToDocbook opts = vcat . map (blockToDocbook opts)
155
blocksToDocbook :: WriterOptions -> [Block] -> Doc blocksToDocbook opts = vcat . map (blockToDocbook opts)
106
blocksToDocbook opts = vcat . map (blockToDocbook opts)
55
true
true
0
8
24
39
20
19
null
null
andorp/hs-bluesnap
src/Bluesnap/API/Response.hs
gpl-3.0
elementWire :: XMLParser Wire elementWire = parseSchemaType "wire"
66
elementWire :: XMLParser Wire elementWire = parseSchemaType "wire"
66
elementWire = parseSchemaType "wire"
36
false
true
0
5
7
17
8
9
null
null
matterhorn-chat/matterhorn
test/test_messages.hs
bsd-3-clause
moveUpTestMultipleStart :: TestTree moveUpTestMultipleStart = testProperty "Move up in multiple messages from the start" $ \(x', y', z') -> let [x, y, z] = setDateOrderMessages [ postMsg x', postMsg y', postMsg z'] ...
737
moveUpTestMultipleStart :: TestTree moveUpTestMultipleStart = testProperty "Move up in multiple messages from the start" $ \(x', y', z') -> let [x, y, z] = setDateOrderMessages [ postMsg x', postMsg y', postMsg z'] ...
737
moveUpTestMultipleStart = testProperty "Move up in multiple messages from the start" $ \(x', y', z') -> let [x, y, z] = setDateOrderMessages [ postMsg x', postMsg y', postMsg z'] msgs = makeMsgs [x, y...
701
false
true
0
13
363
159
80
79
null
null
tdfirth/lambda
src/Lambda/Parse.hs
mit
parseList :: Parser LispVal parseList = liftM List $ sepEndBy parseExpr spaces
78
parseList :: Parser LispVal parseList = liftM List $ sepEndBy parseExpr spaces
78
parseList = liftM List $ sepEndBy parseExpr spaces
50
false
true
0
6
11
26
12
14
null
null
diku-dk/futhark
src/Futhark/Transform/Rename.hs
isc
-- | Rename bound variables such that each is unique. The semantics -- of the lambda is unaffected, under the assumption that the body was -- correct to begin with. Any free variables are left untouched. -- Note in particular that the parameters of the lambda are renamed. renameLambda :: (Renameable rep, MonadFresh...
418
renameLambda :: (Renameable rep, MonadFreshNames m) => Lambda rep -> m (Lambda rep) renameLambda = modifyNameSource . runRenamer . rename
143
renameLambda = modifyNameSource . runRenamer . rename
53
true
true
0
7
75
54
29
25
null
null
nlv/genexpr
src/Generate.hs
gpl-2.0
-- | Вычислить значение выражения eval :: Expr -> Int eval (Num n) = n
70
eval :: Expr -> Int eval (Num n) = n
36
eval (Num n) = n
16
true
true
0
9
14
31
14
17
null
null
brendanhay/gogol
gogol-servicemanagement/gen/Network/Google/Resource/ServiceManagement/Services/Undelete.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). suUploadProtocol :: Lens' ServicesUndelete (Maybe Text) suUploadProtocol = lens _suUploadProtocol (\ s a -> s{_suUploadProtocol = a})
203
suUploadProtocol :: Lens' ServicesUndelete (Maybe Text) suUploadProtocol = lens _suUploadProtocol (\ s a -> s{_suUploadProtocol = a})
141
suUploadProtocol = lens _suUploadProtocol (\ s a -> s{_suUploadProtocol = a})
85
true
true
0
9
33
48
25
23
null
null
plow-technologies/ghcjs-dom
src/Main.hs
mit
-- Hello World exeMain = do putStrLn (hello "World") -- Entry point for unit tests.
88
exeMain = do putStrLn (hello "World") -- Entry point for unit tests.
73
exeMain = do putStrLn (hello "World") -- Entry point for unit tests.
73
true
false
0
9
19
20
10
10
null
null
owainlewis/ava
src/Language/Ava/Apply.hs
bsd-3-clause
_stack :: AvaFunction _stack s = liftExcept (Stack.modifyM (\xs -> return $ liftPrim (Quotation xs) : xs) s)
110
_stack :: AvaFunction _stack s = liftExcept (Stack.modifyM (\xs -> return $ liftPrim (Quotation xs) : xs) s)
110
_stack s = liftExcept (Stack.modifyM (\xs -> return $ liftPrim (Quotation xs) : xs) s)
88
false
true
0
14
19
52
26
26
null
null
rcobbe/language-tools
test/Latin/LetterTest.hs
apache-2.0
assertFalse = assert . not
26
assertFalse = assert . not
26
assertFalse = assert . not
26
false
false
0
5
4
10
5
5
null
null
ratsam/hs-carbon-aggregator
src/daemon/Main.hs
apache-2.0
main :: IO () main = AggregatorOptions.withOptionsDo $ \options -> do let instanceName = AggregatorOptions.instanceName options econf <- resolveConfiguration (AggregatorOptions.configPath options) instanceName case econf of Left errorMsg -> do putStrLn errorMsg putStrLn "You...
1,026
main :: IO () main = AggregatorOptions.withOptionsDo $ \options -> do let instanceName = AggregatorOptions.instanceName options econf <- resolveConfiguration (AggregatorOptions.configPath options) instanceName case econf of Left errorMsg -> do putStrLn errorMsg putStrLn "You...
1,026
main = AggregatorOptions.withOptionsDo $ \options -> do let instanceName = AggregatorOptions.instanceName options econf <- resolveConfiguration (AggregatorOptions.configPath options) instanceName case econf of Left errorMsg -> do putStrLn errorMsg putStrLn "You can find more...
1,012
false
true
0
23
267
185
86
99
null
null
twittner/redis-resp
src/Data/Redis/Command.hs
mpl-2.0
lpop :: (Monad m, FromByteString a) => Key -> Redis m (Maybe a) lpop k = singleton $ LPop $ cmd 2 ["LPOP", key k]
113
lpop :: (Monad m, FromByteString a) => Key -> Redis m (Maybe a) lpop k = singleton $ LPop $ cmd 2 ["LPOP", key k]
113
lpop k = singleton $ LPop $ cmd 2 ["LPOP", key k]
49
false
true
0
10
24
70
34
36
null
null
spechub/Hets
Propositional/Prop2CASLHelpers.hs
gpl-2.0
-- | Translation of morphisms mapMor :: PMor.Morphism -> Result.Result CMor.CASLMor mapMor mor = Result.Result [] $ Just (CMor.embedMorphism () (mapSig $ PMor.source mor) $ mapSig $ PMor.target mor) { CMor.pred_map = trMor $ PMor.propMap mor }
251
mapMor :: PMor.Morphism -> Result.Result CMor.CASLMor mapMor mor = Result.Result [] $ Just (CMor.embedMorphism () (mapSig $ PMor.source mor) $ mapSig $ PMor.target mor) { CMor.pred_map = trMor $ PMor.propMap mor }
221
mapMor mor = Result.Result [] $ Just (CMor.embedMorphism () (mapSig $ PMor.source mor) $ mapSig $ PMor.target mor) { CMor.pred_map = trMor $ PMor.propMap mor }
167
true
true
0
14
44
106
50
56
null
null
mbakke/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
idiskAccess :: String idiskAccess = "access"
44
idiskAccess :: String idiskAccess = "access"
44
idiskAccess = "access"
22
false
true
0
4
5
11
6
5
null
null
acmumn/umnlookup
umnlookup.hs
bsd-3-clause
printFieldValuesNoTTY :: [String] -> IO () printFieldValuesNoTTY strs = mapM_ putStr (intersperse ";" $ fmap (escapeCSV . strip) strs)
165
printFieldValuesNoTTY :: [String] -> IO () printFieldValuesNoTTY strs = mapM_ putStr (intersperse ";" $ fmap (escapeCSV . strip) strs)
165
printFieldValuesNoTTY strs = mapM_ putStr (intersperse ";" $ fmap (escapeCSV . strip) strs)
122
false
true
0
10
49
53
26
27
null
null
apriori/daak
lib/DAAK/Algorithms/Gamo.hs
mit
keepOrderReplace :: PackingFullChromosome -> PackingFullChromosome -> PackingFullChromosome keepOrderReplace a b = ( selectorChromosome b , orderChromosome a , orientationChromosome b , fillOrderChromosome b , packingChromosome b )
283
keepOrderReplace :: PackingFullChromosome -> PackingFullChromosome -> PackingFullChromosome keepOrderReplace a b = ( selectorChromosome b , orderChromosome a , orientationChromosome b , fillOrderChromosome b , packingChromosome b )
283
keepOrderReplace a b = ( selectorChromosome b , orderChromosome a , orientationChromosome b , fillOrderChromosome b , packingChromosome b )
151
false
true
0
6
78
54
27
27
null
null
Hodapp87/ivory
ivory/src/Ivory/Language/Plugin.hs
bsd-3-clause
install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo] install opts todos = do reinitializeGlobals hsc_env <- getHscEnv Just withLocName <- liftIO $ lookupRdrNameInModuleForPlugins hsc_env iVORY_MONAD wITH_LOC withLocVar <- lookupId withLocName Just mkLocName <- liftIO $ lookupRdrNameInModuleForP...
763
install :: [CommandLineOption] -> [CoreToDo] -> CoreM [CoreToDo] install opts todos = do reinitializeGlobals hsc_env <- getHscEnv Just withLocName <- liftIO $ lookupRdrNameInModuleForPlugins hsc_env iVORY_MONAD wITH_LOC withLocVar <- lookupId withLocName Just mkLocName <- liftIO $ lookupRdrNameInModuleForP...
763
install opts todos = do reinitializeGlobals hsc_env <- getHscEnv Just withLocName <- liftIO $ lookupRdrNameInModuleForPlugins hsc_env iVORY_MONAD wITH_LOC withLocVar <- lookupId withLocName Just mkLocName <- liftIO $ lookupRdrNameInModuleForPlugins hsc_env iVORY_MONAD mK_LOC mkLocVar <- lookupId mkLocNam...
698
false
true
0
10
118
211
96
115
null
null
brendanhay/gogol
gogol-run/gen/Network/Google/Run/Types/Product.hs
mpl-2.0
-- | (Optional) Name of the container specified as a DNS_LABEL. Currently -- unused in Cloud Run. More info: -- https:\/\/kubernetes.io\/docs\/concepts\/overview\/working-with-objects\/names\/#dns-label-names cName :: Lens' Container (Maybe Text) cName = lens _cName (\ s a -> s{_cName = a})
291
cName :: Lens' Container (Maybe Text) cName = lens _cName (\ s a -> s{_cName = a})
82
cName = lens _cName (\ s a -> s{_cName = a})
44
true
true
0
9
37
48
27
21
null
null
pheaver/BitVector
Data/BitVector/BitVector2.hs
bsd-3-clause
dropL :: Int -> BitVector -> BitVector dropL i (BV w a b) = BV (w-i) (maskWidth (w-i) a) (maskWidth (w-i) b)
110
dropL :: Int -> BitVector -> BitVector dropL i (BV w a b) = BV (w-i) (maskWidth (w-i) a) (maskWidth (w-i) b)
110
dropL i (BV w a b) = BV (w-i) (maskWidth (w-i) a) (maskWidth (w-i) b)
71
false
true
0
9
23
78
40
38
null
null
alexander-at-github/eta
compiler/ETA/SimplCore/SimplEnv.hs
bsd-3-clause
------------------ substIdType :: SimplEnv -> Id -> Id substIdType (SimplEnv { seInScope = in_scope, seTvSubst = tv_env }) id | isEmptyVarEnv tv_env || isEmptyVarSet (tyVarsOfType old_ty) = id | otherwise = Id.setIdType id (Type.substTy (TvSubst in_scope tv_env) old_ty) -- The tyVarsOfType is cheap...
484
substIdType :: SimplEnv -> Id -> Id substIdType (SimplEnv { seInScope = in_scope, seTvSubst = tv_env }) id | isEmptyVarEnv tv_env || isEmptyVarSet (tyVarsOfType old_ty) = id | otherwise = Id.setIdType id (Type.substTy (TvSubst in_scope tv_env) old_ty) -- The tyVarsOfType is cheaper than it looks ...
465
substIdType (SimplEnv { seInScope = in_scope, seTvSubst = tv_env }) id | isEmptyVarEnv tv_env || isEmptyVarSet (tyVarsOfType old_ty) = id | otherwise = Id.setIdType id (Type.substTy (TvSubst in_scope tv_env) old_ty) -- The tyVarsOfType is cheaper than it looks -- because we cache th...
429
true
true
1
11
128
111
57
54
null
null
raventid/coursera_learning
haskell/chpater5/worksheet.hs
mit
--magical function wich allow transform concrete Int from `length` into polymorphic Num myIntegralValue = fromIntegral (length myList)
134
myIntegralValue = fromIntegral (length myList)
46
myIntegralValue = fromIntegral (length myList)
46
true
false
0
7
16
16
8
8
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/Desugar710/Coverage.hs
bsd-3-clause
addTickHsLocalBinds (HsIPBinds binds) = liftM HsIPBinds (addTickHsIPBinds binds)
105
addTickHsLocalBinds (HsIPBinds binds) = liftM HsIPBinds (addTickHsIPBinds binds)
105
addTickHsLocalBinds (HsIPBinds binds) = liftM HsIPBinds (addTickHsIPBinds binds)
105
false
false
0
7
32
26
12
14
null
null
chreekat/yesod
yesod-routes/Yesod/Routes/Overlap.hs
bsd-2-clause
piecesOverlap _ _ = True
24
piecesOverlap _ _ = True
24
piecesOverlap _ _ = True
24
false
false
0
5
4
11
5
6
null
null
supermario/stack
src/Stack/Types/Package.hs
bsd-3-clause
-- | Get the path. dotCabalGetPath :: DotCabalPath -> Path Abs File dotCabalGetPath dcp = case dcp of DotCabalModulePath fp -> fp DotCabalMainPath fp -> fp DotCabalFilePath fp -> fp DotCabalCFilePath fp -> fp
244
dotCabalGetPath :: DotCabalPath -> Path Abs File dotCabalGetPath dcp = case dcp of DotCabalModulePath fp -> fp DotCabalMainPath fp -> fp DotCabalFilePath fp -> fp DotCabalCFilePath fp -> fp
225
dotCabalGetPath dcp = case dcp of DotCabalModulePath fp -> fp DotCabalMainPath fp -> fp DotCabalFilePath fp -> fp DotCabalCFilePath fp -> fp
176
true
true
0
8
69
64
30
34
null
null
stephenjbarr/parody-bot
src/NeoParodyInterface.hs
bsd-3-clause
item_types = ["Track", "Artist", "Album", "Playlist"]
53
item_types = ["Track", "Artist", "Album", "Playlist"]
53
item_types = ["Track", "Artist", "Album", "Playlist"]
53
false
false
1
5
5
21
11
10
null
null
creswick/HaVSA
src/AI/VersionSpaces.hs
bsd-3-clause
showVS (Union vs1 vs2) = "["++showVS vs1++" U "++showVS vs2++"]"
64
showVS (Union vs1 vs2) = "["++showVS vs1++" U "++showVS vs2++"]"
64
showVS (Union vs1 vs2) = "["++showVS vs1++" U "++showVS vs2++"]"
64
false
false
0
9
9
39
18
21
null
null
diku-kmc/repg
test/Tests/Regression.hs
mit
unsound_lookahead :: IO TS.Result unsound_lookahead = let fst' = constructTransducer la_prog 0 sst1 = sstFromFST fst' True sst2 = sstFromFST fst' False in if flattenStream (SST.run sst1 [0,1]) == flattenStream (SST.run sst2 [0,1]) then return TS.Pass else return $ TS.Fail "Lookahe...
368
unsound_lookahead :: IO TS.Result unsound_lookahead = let fst' = constructTransducer la_prog 0 sst1 = sstFromFST fst' True sst2 = sstFromFST fst' False in if flattenStream (SST.run sst1 [0,1]) == flattenStream (SST.run sst2 [0,1]) then return TS.Pass else return $ TS.Fail "Lookahe...
368
unsound_lookahead = let fst' = constructTransducer la_prog 0 sst1 = sstFromFST fst' True sst2 = sstFromFST fst' False in if flattenStream (SST.run sst1 [0,1]) == flattenStream (SST.run sst2 [0,1]) then return TS.Pass else return $ TS.Fail "Lookahead optimization changes output sem...
334
false
true
0
12
85
116
58
58
null
null
pheaver/BitVector
Data/BitVector/BitVector2.hs
bsd-3-clause
append (BV w0 a0 b0) (BV w1 a1 b1) = BV (w0 + w1) (Bits.shiftL a0 w1 .|. a1) (Bits.shiftL b0 w1 .|. b1)
105
append (BV w0 a0 b0) (BV w1 a1 b1) = BV (w0 + w1) (Bits.shiftL a0 w1 .|. a1) (Bits.shiftL b0 w1 .|. b1)
105
append (BV w0 a0 b0) (BV w1 a1 b1) = BV (w0 + w1) (Bits.shiftL a0 w1 .|. a1) (Bits.shiftL b0 w1 .|. b1)
105
false
false
0
9
25
73
36
37
null
null
da-x/buildsome
src/Buildsome/Print.hs
gpl-2.0
colorStdOutputs :: StdOutputs ByteString -> StdOutputs ColorText colorStdOutputs (StdOutputs out err) = StdOutputs (colorize cStdout out) (colorize cStderr err) where colorize f = f . fromBytestring8 . chopTrailingNewline Color.Scheme{..} = Color.scheme
269
colorStdOutputs :: StdOutputs ByteString -> StdOutputs ColorText colorStdOutputs (StdOutputs out err) = StdOutputs (colorize cStdout out) (colorize cStderr err) where colorize f = f . fromBytestring8 . chopTrailingNewline Color.Scheme{..} = Color.scheme
269
colorStdOutputs (StdOutputs out err) = StdOutputs (colorize cStdout out) (colorize cStderr err) where colorize f = f . fromBytestring8 . chopTrailingNewline Color.Scheme{..} = Color.scheme
204
false
true
1
8
46
88
42
46
null
null
Drezil/htrace
src/Main.hs
mit
findAmbience (a:as) = case a of OpA am -> return am _ -> findAmbience as
112
findAmbience (a:as) = case a of OpA am -> return am _ -> findAmbience as
112
findAmbience (a:as) = case a of OpA am -> return am _ -> findAmbience as
112
false
false
0
8
54
41
19
22
null
null
mcschroeder/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
pprSplice (HsUntypedSplice n e) = ppr_splice (text "$") n e
61
pprSplice (HsUntypedSplice n e) = ppr_splice (text "$") n e
61
pprSplice (HsUntypedSplice n e) = ppr_splice (text "$") n e
61
false
false
0
7
11
31
14
17
null
null
david-caro/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkForInQuoted6 = verifyNot checkForInQuoted "for f in \"${!arr}\"; do true; done"
89
prop_checkForInQuoted6 = verifyNot checkForInQuoted "for f in \"${!arr}\"; do true; done"
89
prop_checkForInQuoted6 = verifyNot checkForInQuoted "for f in \"${!arr}\"; do true; done"
89
false
false
0
5
10
11
5
6
null
null
nevrenato/Hets_Fork
CSL/Keywords.hs
gpl-2.0
sumS :: String sumS = "sum"
28
sumS :: String sumS = "sum"
27
sumS = "sum"
12
false
true
0
6
6
18
7
11
null
null
input-output-hk/pos-haskell-prototype
db/src/Pos/DB/Delegation/Logic/Mempool.hs
mit
modifyDlgMemPool :: (DlgMemPool -> DlgMemPool) -> DelegationStateAction () modifyDlgMemPool f = do memPool <- use dwProxySKPool let newPool = f memPool let newSize = biSize newPool dwProxySKPool .= newPool dwPoolSize .= newSize -----------------------------------------------------------------------...
497
modifyDlgMemPool :: (DlgMemPool -> DlgMemPool) -> DelegationStateAction () modifyDlgMemPool f = do memPool <- use dwProxySKPool let newPool = f memPool let newSize = biSize newPool dwProxySKPool .= newPool dwPoolSize .= newSize -----------------------------------------------------------------------...
497
modifyDlgMemPool f = do memPool <- use dwProxySKPool let newPool = f memPool let newSize = biSize newPool dwProxySKPool .= newPool dwPoolSize .= newSize ---------------------------------------------------------------------------- -- Heavyweight PSKs processing --------------------------------------...
422
false
true
1
11
69
83
39
44
null
null
danoctavian/bit-smuggler
scripts/Main.hs
gpl-2.0
tryMaybeBitTorrentProxy port = do Proxy.run $ Proxy.Config { Proxy.proxyPort = port , Proxy.initHook = (\ _ _ -> return $ Proxy.DataHooks idleHook idleHook (return ())) , Proxy.handshake = Socks4.serverProtocol , Proxy.redirects = Map.empty ...
331
tryMaybeBitTorrentProxy port = do Proxy.run $ Proxy.Config { Proxy.proxyPort = port , Proxy.initHook = (\ _ _ -> return $ Proxy.DataHooks idleHook idleHook (return ())) , Proxy.handshake = Socks4.serverProtocol , Proxy.redirects = Map.empty ...
331
tryMaybeBitTorrentProxy port = do Proxy.run $ Proxy.Config { Proxy.proxyPort = port , Proxy.initHook = (\ _ _ -> return $ Proxy.DataHooks idleHook idleHook (return ())) , Proxy.handshake = Socks4.serverProtocol , Proxy.redirects = Map.empty ...
331
false
false
0
16
122
89
48
41
null
null
mdibaiee/serverman
src/System/Serverman/Log.hs
gpl-3.0
clearLine :: IO () clearLine = do putStr "\ESC[2K\ESC[0;" hFlush stdout
81
clearLine :: IO () clearLine = do putStr "\ESC[2K\ESC[0;" hFlush stdout
79
clearLine = do putStr "\ESC[2K\ESC[0;" hFlush stdout
60
false
true
0
7
20
28
12
16
null
null
matthieubulte/sucks-rocks
Main.hs
mit
serve :: Int -> IO () serve port = S.scotty port $ do S.middleware . staticPolicy $ addBase "static" S.middleware . staticPolicy $ addBase "bower_components" S.get "/" $ S.file "static/index.html" S.get "/snippets" $ do snippets <- liftIO getSnippets S.json $ snippetEntityToJson <$> snipp...
1,188
serve :: Int -> IO () serve port = S.scotty port $ do S.middleware . staticPolicy $ addBase "static" S.middleware . staticPolicy $ addBase "bower_components" S.get "/" $ S.file "static/index.html" S.get "/snippets" $ do snippets <- liftIO getSnippets S.json $ snippetEntityToJson <$> snipp...
1,188
serve port = S.scotty port $ do S.middleware . staticPolicy $ addBase "static" S.middleware . staticPolicy $ addBase "bower_components" S.get "/" $ S.file "static/index.html" S.get "/snippets" $ do snippets <- liftIO getSnippets S.json $ snippetEntityToJson <$> snippets S.post "/snip...
1,166
false
true
0
22
386
412
181
231
null
null
jgoerzen/missingpy
Python/Objects.hs
gpl-2.0
{- | Gets a string representation of a Python object. Same as str(x) in Python. -} strOf :: PyObject -> IO String strOf x = withPyObject x (\pyo -> pyObject_Str pyo >>= fromCPyObject >>= fromPyObject)
215
strOf :: PyObject -> IO String strOf x = withPyObject x (\pyo -> pyObject_Str pyo >>= fromCPyObject >>= fromPyObject)
130
strOf x = withPyObject x (\pyo -> pyObject_Str pyo >>= fromCPyObject >>= fromPyObject)
99
true
true
0
10
49
52
24
28
null
null
bos/criterion
Criterion/Analysis.hs
bsd-2-clause
-- | Display a report of the 'Outliers' present in a 'Sample'. noteOutliers :: Outliers -> Criterion () noteOutliers o = do let frac n = (100::Double) * fromIntegral n / fromIntegral (samplesSeen o) check :: Int64 -> Double -> String -> Criterion () check k t d = when (frac k > t) $ no...
680
noteOutliers :: Outliers -> Criterion () noteOutliers o = do let frac n = (100::Double) * fromIntegral n / fromIntegral (samplesSeen o) check :: Int64 -> Double -> String -> Criterion () check k t d = when (frac k > t) $ note " %d (%.1g%%) %s\n" k (frac k) d outCount = countOutl...
617
noteOutliers o = do let frac n = (100::Double) * fromIntegral n / fromIntegral (samplesSeen o) check :: Int64 -> Double -> String -> Criterion () check k t d = when (frac k > t) $ note " %d (%.1g%%) %s\n" k (frac k) d outCount = countOutliers o when (outCount > 0) $ do _ <...
576
true
true
0
14
184
245
115
130
null
null
joelburget/sdl2-ttf
Graphics/UI/SDL/TTF/Render.hs
bsd-3-clause
tryRenderUTF8Shaded :: Font -> String -> Color -> Color -> IO (Maybe Surface) tryRenderUTF8Shaded = renderTwoColor ttfRenderUTF8Shaded
134
tryRenderUTF8Shaded :: Font -> String -> Color -> Color -> IO (Maybe Surface) tryRenderUTF8Shaded = renderTwoColor ttfRenderUTF8Shaded
134
tryRenderUTF8Shaded = renderTwoColor ttfRenderUTF8Shaded
56
false
true
0
11
16
39
19
20
null
null
fffej/codekatas
99Problems/1-20/Problems.hs
mit
decodeModified :: Eq a => [CompressToken a] -> [a] decodeModified = concatMap fromToken where fromToken (Single x) = [x] fromToken (Multiple n x) = replicate n x
172
decodeModified :: Eq a => [CompressToken a] -> [a] decodeModified = concatMap fromToken where fromToken (Single x) = [x] fromToken (Multiple n x) = replicate n x
172
decodeModified = concatMap fromToken where fromToken (Single x) = [x] fromToken (Multiple n x) = replicate n x
121
false
true
0
8
37
75
37
38
null
null
DrNico/rhodium
tools/rhc-strap/Rhodium/Eval.hs
mit
unify :: Pat -> Value -> Maybe Binds unify (PVar name) val = Just [(name,val)]
80
unify :: Pat -> Value -> Maybe Binds unify (PVar name) val = Just [(name,val)]
80
unify (PVar name) val = Just [(name,val)]
43
false
true
0
7
16
45
23
22
null
null
OS2World/DEV-UTIL-HUGS
oldlib/SizedSeq.hs
bsd-3-clause
zipWith3 f (N l xs) (N m ys) (N n zs) = N (min l (min m n)) (S.zipWith3 f xs ys zs)
83
zipWith3 f (N l xs) (N m ys) (N n zs) = N (min l (min m n)) (S.zipWith3 f xs ys zs)
83
zipWith3 f (N l xs) (N m ys) (N n zs) = N (min l (min m n)) (S.zipWith3 f xs ys zs)
83
false
false
0
9
22
74
36
38
null
null
eggplantbren/NestedSampling.hs
test/Models/Ising.hs
mit
-- Log likelihood function logLikelihood :: IsingState -> Double logLikelihood (IsingState _ energy) = negate $ fromIntegral energy
131
logLikelihood :: IsingState -> Double logLikelihood (IsingState _ energy) = negate $ fromIntegral energy
104
logLikelihood (IsingState _ energy) = negate $ fromIntegral energy
66
true
true
0
7
17
34
17
17
null
null
JacquesCarette/literate-scientific-software
code/drasil-code/Language/Drasil/Code/ExtLibImport.hs
bsd-2-clause
genParameters (NameableParam _:ps) (NameableParamF c:pfs) = c : genParameters ps pfs
87
genParameters (NameableParam _:ps) (NameableParamF c:pfs) = c : genParameters ps pfs
87
genParameters (NameableParam _:ps) (NameableParamF c:pfs) = c : genParameters ps pfs
87
false
false
0
8
13
45
20
25
null
null
dysinger/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs
mpl-2.0
lDefaultRecipes :: Lens' Layer (Maybe Recipes) lDefaultRecipes = lens _lDefaultRecipes (\s a -> s { _lDefaultRecipes = a })
123
lDefaultRecipes :: Lens' Layer (Maybe Recipes) lDefaultRecipes = lens _lDefaultRecipes (\s a -> s { _lDefaultRecipes = a })
123
lDefaultRecipes = lens _lDefaultRecipes (\s a -> s { _lDefaultRecipes = a })
76
false
true
0
9
18
45
24
21
null
null
Procrat/xmonad-contexts
XMonad/Actions/Contexts.hs
mit
newWS :: X WindowSet newWS = withDisplay $ \dpy -> do xinesc <- getCleanedScreenInfo dpy xconf <- ask let conf = config xconf layout = layoutHook conf padToLen n xs = take (max n (length xs)) $ xs ++ repeat "" workspaces' = padToLen (length xinesc) (workspaces conf) sds = map...
372
newWS :: X WindowSet newWS = withDisplay $ \dpy -> do xinesc <- getCleanedScreenInfo dpy xconf <- ask let conf = config xconf layout = layoutHook conf padToLen n xs = take (max n (length xs)) $ xs ++ repeat "" workspaces' = padToLen (length xinesc) (workspaces conf) sds = map...
372
newWS = withDisplay $ \dpy -> do xinesc <- getCleanedScreenInfo dpy xconf <- ask let conf = config xconf layout = layoutHook conf padToLen n xs = take (max n (length xs)) $ xs ++ repeat "" workspaces' = padToLen (length xinesc) (workspaces conf) sds = map SD xinesc return...
351
false
true
2
18
106
153
70
83
null
null
gallais/potpourri
haskell/syntax-with-binding/Examples.hs
gpl-3.0
------------------------------------------------------------- -- EXAMPLES FOR CLF ------------------------------------------------------------- ones :: CList Integer ones = CList $ CLCON' 1 $ Var Z
198
ones :: CList Integer ones = CList $ CLCON' 1 $ Var Z
53
ones = CList $ CLCON' 1 $ Var Z
31
true
true
0
7
19
31
16
15
null
null
pgavin/secdh
lib/Language/Slambda/Read.hs
bsd-3-clause
parseProgram :: String -> Maybe Program parseProgram str = case readP_to_S (do p <- program; eof; return p) str of [(p, "")] -> Just p [] -> Nothing parses -> error $ foldr (.) id (showString "multiple parses:\n" : intersperse (showChar '\n') (map shows parses)) ""
289
parseProgram :: String -> Maybe Program parseProgram str = case readP_to_S (do p <- program; eof; return p) str of [(p, "")] -> Just p [] -> Nothing parses -> error $ foldr (.) id (showString "multiple parses:\n" : intersperse (showChar '\n') (map shows parses)) ""
289
parseProgram str = case readP_to_S (do p <- program; eof; return p) str of [(p, "")] -> Just p [] -> Nothing parses -> error $ foldr (.) id (showString "multiple parses:\n" : intersperse (showChar '\n') (map shows parses)) ""
249
false
true
0
14
69
128
63
65
null
null
dorchard/gram_lang
frontend/src/Language/Granule/Checker/Constraints/SymbolicGrades.hs
bsd-3-clause
applyToProducts f g h a@(SProduct a1 b1) c = if match a1 c then Right $ liftM2 g (f a1 c) (return $ h b1) else if match b1 c then Right $ liftM2 g (return $ h a1) (f b1 c) else Left $ "Solver grades " <> show a <> " and " <> show c <> " are incompatible "
283
applyToProducts f g h a@(SProduct a1 b1) c = if match a1 c then Right $ liftM2 g (f a1 c) (return $ h b1) else if match b1 c then Right $ liftM2 g (return $ h a1) (f b1 c) else Left $ "Solver grades " <> show a <> " and " <> show c <> " are incompatible "
283
applyToProducts f g h a@(SProduct a1 b1) c = if match a1 c then Right $ liftM2 g (f a1 c) (return $ h b1) else if match b1 c then Right $ liftM2 g (return $ h a1) (f b1 c) else Left $ "Solver grades " <> show a <> " and " <> show c <> " are incompatible "
283
false
false
0
11
90
138
68
70
null
null
DavidAlphaFox/ghc
compiler/hsSyn/HsDecls.hs
bsd-3-clause
lvectDeclName (L _ (HsVectInstOut _)) = panic "HsDecls.lvectDeclName: HsVectInstOut"
87
lvectDeclName (L _ (HsVectInstOut _)) = panic "HsDecls.lvectDeclName: HsVectInstOut"
87
lvectDeclName (L _ (HsVectInstOut _)) = panic "HsDecls.lvectDeclName: HsVectInstOut"
87
false
false
0
9
11
26
12
14
null
null
lambda-11235/ttyped
src/Check.hs
gpl-3.0
unifyObjects (App o1 o2) (App o3 o4) = (unifyObjects o1 o3) && (unifyObjects o2 o4)
83
unifyObjects (App o1 o2) (App o3 o4) = (unifyObjects o1 o3) && (unifyObjects o2 o4)
83
unifyObjects (App o1 o2) (App o3 o4) = (unifyObjects o1 o3) && (unifyObjects o2 o4)
83
false
false
1
8
14
51
23
28
null
null