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
yesodweb/shakespeare
test/Text/CssSpec.hs
mit
encodeUrlChar ' ' = "+"
23
encodeUrlChar ' ' = "+"
23
encodeUrlChar ' ' = "+"
23
false
false
0
5
4
9
4
5
null
null
ekmett/containers
Data/IntSet/Base.hs
bsd-3-clause
difference t@(Bin _ _ _ _) (Tip kx bm) = deleteBM kx bm t
57
difference t@(Bin _ _ _ _) (Tip kx bm) = deleteBM kx bm t
57
difference t@(Bin _ _ _ _) (Tip kx bm) = deleteBM kx bm t
57
false
false
0
8
13
41
20
21
null
null
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs
bsd-3-clause
gl_TEXTURE_BLUE_TYPE :: GLenum gl_TEXTURE_BLUE_TYPE = 0x8C12
60
gl_TEXTURE_BLUE_TYPE :: GLenum gl_TEXTURE_BLUE_TYPE = 0x8C12
60
gl_TEXTURE_BLUE_TYPE = 0x8C12
29
false
true
0
4
5
11
6
5
null
null
forked-upstream-packages-for-ghcjs/ghc
utils/hpc/HpcFlags.hs
bsd-3-clause
-- We do this after reading flags, because the defaults -- depends on if specific flags we used. default_final_flags :: Flags -> Flags default_final_flags flags = flags { srcDirs = if null (srcDirs flags) then ["."] else srcDirs flags }
269
default_final_flags :: Flags -> Flags default_final_flags flags = flags { srcDirs = if null (srcDirs flags) then ["."] else srcDirs flags }
171
default_final_flags flags = flags { srcDirs = if null (srcDirs flags) then ["."] else srcDirs flags }
133
true
true
0
11
72
55
29
26
null
null
mmarx/jebediah
cli/spaceplane-hangar/Main.hs
gpl-3.0
chordify :: [Note] -> Line chordify ns = Music.line [ Music.chord $ [ toNote . transpose i $ n | i <- [ 0 , 4 , 7 , 12 , 24 ...
551
chordify :: [Note] -> Line chordify ns = Music.line [ Music.chord $ [ toNote . transpose i $ n | i <- [ 0 , 4 , 7 , 12 , 24 ...
551
chordify ns = Music.line [ Music.chord $ [ toNote . transpose i $ n | i <- [ 0 , 4 , 7 , 12 , 24 , -9...
524
false
true
0
12
439
95
52
43
null
null
andyarvanitis/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
irts_c FUnit x = x
18
irts_c FUnit x = x
18
irts_c FUnit x = x
18
false
false
0
5
4
11
5
6
null
null
fmapfmapfmap/amazonka
amazonka-codedeploy/gen/Network/AWS/CodeDeploy/Types/Product.hs
mpl-2.0
-- | The application name. dgiApplicationName :: Lens' DeploymentGroupInfo (Maybe Text) dgiApplicationName = lens _dgiApplicationName (\ s a -> s{_dgiApplicationName = a})
171
dgiApplicationName :: Lens' DeploymentGroupInfo (Maybe Text) dgiApplicationName = lens _dgiApplicationName (\ s a -> s{_dgiApplicationName = a})
144
dgiApplicationName = lens _dgiApplicationName (\ s a -> s{_dgiApplicationName = a})
83
true
true
0
9
21
46
25
21
null
null
frantisekfarka/ghc-dsi
compiler/main/GhcMonad.hs
bsd-3-clause
-- | Set the current session to the result of applying the current session to -- the argument. modifySession :: GhcMonad m => (HscEnv -> HscEnv) -> m () modifySession f = do h <- getSession setSession $! f h
228
modifySession :: GhcMonad m => (HscEnv -> HscEnv) -> m () modifySession f = do h <- getSession setSession $! f h
133
modifySession f = do h <- getSession setSession $! f h
75
true
true
0
8
60
56
27
29
null
null
elblake/expiring-cache-map
tests/TestHashECMWithThreadsInvalidating.hs
bsd-3-clause
testWithThreadsInvalidating' = do ecm <- newECMIO (consistentDuration 10 (\state id -> do LBS.putStrLn id; return (state, []))) (do time <- POSIX.getPOSIXTime return (round (time * 100))) 120 (CacheWithLRUList 6 6 12) :: IO (ECM IO MV.MVar...
1,971
testWithThreadsInvalidating' = do ecm <- newECMIO (consistentDuration 10 (\state id -> do LBS.putStrLn id; return (state, []))) (do time <- POSIX.getPOSIXTime return (round (time * 100))) 120 (CacheWithLRUList 6 6 12) :: IO (ECM IO MV.MVar...
1,971
testWithThreadsInvalidating' = do ecm <- newECMIO (consistentDuration 10 (\state id -> do LBS.putStrLn id; return (state, []))) (do time <- POSIX.getPOSIXTime return (round (time * 100))) 120 (CacheWithLRUList 6 6 12) :: IO (ECM IO MV.MVar...
1,971
false
false
0
17
684
869
397
472
null
null
muchas/voice-dot
backend/test/Spec.hs
mit
tests = TestList [TestLabel "spacesJoin1" testSpacesJoin1, TestLabel "spacesJoin2" testSpacesJoin2, TestLabel "testMatchCommand1" testMatchCommand1, TestLabel "testMatchCommand2" testMatchCommand2, TestLabel "testToggleIgnore" testToggleIgnore, ...
685
tests = TestList [TestLabel "spacesJoin1" testSpacesJoin1, TestLabel "spacesJoin2" testSpacesJoin2, TestLabel "testMatchCommand1" testMatchCommand1, TestLabel "testMatchCommand2" testMatchCommand2, TestLabel "testToggleIgnore" testToggleIgnore, ...
685
tests = TestList [TestLabel "spacesJoin1" testSpacesJoin1, TestLabel "spacesJoin2" testSpacesJoin2, TestLabel "testMatchCommand1" testMatchCommand1, TestLabel "testMatchCommand2" testMatchCommand2, TestLabel "testToggleIgnore" testToggleIgnore, ...
685
false
false
0
7
194
89
44
45
null
null
seishun/aoc2016
day18.hs
mit
part1 :: String -> Int part1 = length . filter (== '.') . concat . take 40 . iterate nextRow
92
part1 :: String -> Int part1 = length . filter (== '.') . concat . take 40 . iterate nextRow
92
part1 = length . filter (== '.') . concat . take 40 . iterate nextRow
69
false
true
0
10
19
50
23
27
null
null
meiersi/blaze-binary
src/Data/Blaze/Binary/Decoding.hs
bsd-3-clause
int8 :: Decoder Int8 int8 = storable
36
int8 :: Decoder Int8 int8 = storable
36
int8 = storable
15
false
true
1
5
6
18
7
11
null
null
sopvop/cabal
Cabal/Distribution/Simple/Utils.hs
bsd-3-clause
-- | Find the file corresponding to a Haskell module name. -- -- This is similar to 'findFileWithExtension'' but specialised to a module -- name. The function fails if the file corresponding to the module is missing. -- findModuleFile :: [FilePath] -- ^ build prefix (location of objects) -> [String] ...
1,109
findModuleFile :: [FilePath] -- ^ build prefix (location of objects) -> [String] -- ^ search suffixes -> ModuleName -- ^ module -> IO (FilePath, FilePath) findModuleFile searchPath extensions mod_name = maybe notFound return =<< findFileWithExtension' extensions...
889
findModuleFile searchPath extensions mod_name = maybe notFound return =<< findFileWithExtension' extensions searchPath (ModuleName.toFilePath mod_name) where notFound = die $ "Error: Could not find module: " ++ display mod_name ++ " with any suffix: " ++ show...
684
true
true
3
10
291
117
65
52
null
null
sdiehl/ghc
testsuite/tests/indexed-types/should_compile/T4120.hs
bsd-3-clause
-- Here we get Couldn't match expected type `forall s. MVector s a' -- with actual type `forall s. Mutable Vector s a1' -- Reason: when unifying under a for-all we don't solve type -- equalities. Think more about this. create1 :: (forall s. Mutable Vector s a) -> Int create1 _ = erro...
327
create1 :: (forall s. Mutable Vector s a) -> Int create1 _ = error "urk"
72
create1 _ = error "urk"
23
true
true
0
8
90
45
23
22
null
null
cdxr/haskell-hurl
Physics/Hurl/Internal/Solid.hs
mit
-- | @v = m / d@ volume' :: Mass -> Density -> Volume volume' (Mass m) (Density d) = Volume (m / d)
99
volume' :: Mass -> Density -> Volume volume' (Mass m) (Density d) = Volume (m / d)
82
volume' (Mass m) (Density d) = Volume (m / d)
45
true
true
0
7
23
47
24
23
null
null
Javran/Project-Euler
src/ProjectEuler/CommandLine/CmdSync.hs
mit
updateEditZone :: String -> ([String] -> [String]) -> String -> String updateEditZone zoneIdent mkNewContents = unlines . updateContentLines . lines where zoneBegin = "# ==== " <> zoneIdent <> "_BEGIN" zoneEnd = "# ==== " <> zoneIdent <> "_END" extractSectionBegin :: String -> Maybe String extrac...
1,660
updateEditZone :: String -> ([String] -> [String]) -> String -> String updateEditZone zoneIdent mkNewContents = unlines . updateContentLines . lines where zoneBegin = "# ==== " <> zoneIdent <> "_BEGIN" zoneEnd = "# ==== " <> zoneIdent <> "_END" extractSectionBegin :: String -> Maybe String extrac...
1,660
updateEditZone zoneIdent mkNewContents = unlines . updateContentLines . lines where zoneBegin = "# ==== " <> zoneIdent <> "_BEGIN" zoneEnd = "# ==== " <> zoneIdent <> "_END" extractSectionBegin :: String -> Maybe String extractSectionBegin line = guard (content == zoneBegin) $> sps where ...
1,589
false
true
22
17
526
414
216
198
null
null
mrmonday/Idris-dev
main/Main.hs
bsd-3-clause
showLibs :: IO b showLibs = do libFlags <- getLibFlags putStrLn $ unwords libFlags exitWith ExitSuccess
131
showLibs :: IO b showLibs = do libFlags <- getLibFlags putStrLn $ unwords libFlags exitWith ExitSuccess
131
showLibs = do libFlags <- getLibFlags putStrLn $ unwords libFlags exitWith ExitSuccess
114
false
true
1
9
43
41
16
25
null
null
romanb/amazonka
amazonka-config/gen/Network/AWS/Config/Types.hs
mpl-2.0
-- | The error code indicating that the recording failed. crsLastErrorCode :: Lens' ConfigurationRecorderStatus (Maybe Text) crsLastErrorCode = lens _crsLastErrorCode (\s a -> s { _crsLastErrorCode = a })
204
crsLastErrorCode :: Lens' ConfigurationRecorderStatus (Maybe Text) crsLastErrorCode = lens _crsLastErrorCode (\s a -> s { _crsLastErrorCode = a })
146
crsLastErrorCode = lens _crsLastErrorCode (\s a -> s { _crsLastErrorCode = a })
79
true
true
0
9
28
46
25
21
null
null
siddhanathan/ghc
includes/CodeGen.Platform.hs
bsd-3-clause
-- %esp is the C stack pointer freeReg esi = False
50
freeReg esi = False
19
freeReg esi = False
19
true
false
0
5
10
10
5
5
null
null
ostapneko/gratte-papier
src/Gratte/Command/Encryption.hs
mit
unpad :: BS.ByteString -> Maybe BS.ByteString unpad str = let unpadded = BS.reverse . BS.dropWhile (== '0') . BS.reverse $ str in if wrapEnd `BS.isSuffixOf` unpadded then Just $ BS.take (BS.length unpadded - BS.length wrapEnd) unpadded else Nothing
269
unpad :: BS.ByteString -> Maybe BS.ByteString unpad str = let unpadded = BS.reverse . BS.dropWhile (== '0') . BS.reverse $ str in if wrapEnd `BS.isSuffixOf` unpadded then Just $ BS.take (BS.length unpadded - BS.length wrapEnd) unpadded else Nothing
269
unpad str = let unpadded = BS.reverse . BS.dropWhile (== '0') . BS.reverse $ str in if wrapEnd `BS.isSuffixOf` unpadded then Just $ BS.take (BS.length unpadded - BS.length wrapEnd) unpadded else Nothing
223
false
true
0
13
58
105
53
52
null
null
hpacheco/HAAP
examples/plab/svn/2017li1g186/src/LI11718.hs
mit
bB m i d (s:c) = bB (up m i) (mx i d') d' c where d' = toEnum (((fromEnum d) + k) `mod` 4) k | s == CurvaDir = 1 | s == CurvaEsq = (-1) | otherwise = 0
181
bB m i d (s:c) = bB (up m i) (mx i d') d' c where d' = toEnum (((fromEnum d) + k) `mod` 4) k | s == CurvaDir = 1 | s == CurvaEsq = (-1) | otherwise = 0
181
bB m i d (s:c) = bB (up m i) (mx i d') d' c where d' = toEnum (((fromEnum d) + k) `mod` 4) k | s == CurvaDir = 1 | s == CurvaEsq = (-1) | otherwise = 0
181
false
false
5
14
71
125
61
64
null
null
DougBurke/swish
tests/GraphTest.hs
lgpl-2.1
lmap :: LabelMap LabelMem lmap = tstLabelMap 5 [(s1,(1,1)),(s2,(2,2)),(s3,(3,3)),(s4,(4,4)), (o1,(1,1)),(o2,(2,2)),(o3,(3,3))]
148
lmap :: LabelMap LabelMem lmap = tstLabelMap 5 [(s1,(1,1)),(s2,(2,2)),(s3,(3,3)),(s4,(4,4)), (o1,(1,1)),(o2,(2,2)),(o3,(3,3))]
148
lmap = tstLabelMap 5 [(s1,(1,1)),(s2,(2,2)),(s3,(3,3)),(s4,(4,4)), (o1,(1,1)),(o2,(2,2)),(o3,(3,3))]
122
false
true
1
8
31
127
79
48
null
null
alancocanour/glutton
src/Glutton/Subscription.hs
bsd-3-clause
mergeItem (Just i) (Just is) = is { itemTitle = getItemTitle i , itemLink = getItemLink i , itemPublishDateString = getItemPublishDateString i , itemDate = getItemDate i , itemAuthor = getItemAuthor i , itemCommentLink = getItemCommentLink i , itemEnclosure = getItemEnclosure i , it...
521
mergeItem (Just i) (Just is) = is { itemTitle = getItemTitle i , itemLink = getItemLink i , itemPublishDateString = getItemPublishDateString i , itemDate = getItemDate i , itemAuthor = getItemAuthor i , itemCommentLink = getItemCommentLink i , itemEnclosure = getItemEnclosure i , it...
521
mergeItem (Just i) (Just is) = is { itemTitle = getItemTitle i , itemLink = getItemLink i , itemPublishDateString = getItemPublishDateString i , itemDate = getItemDate i , itemAuthor = getItemAuthor i , itemCommentLink = getItemCommentLink i , itemEnclosure = getItemEnclosure i , it...
521
false
false
0
8
129
139
73
66
null
null
migpornar/SRTenHaskell
Codigo_Haskell/Orden.hs
gpl-3.0
-- Funciones útiles -- ================ -- | vacio es el multiconjunto vacío. Por ejemplo, -- >>> vacio -- fromOccurList [] vacio :: M.MultiSet a vacio = M.empty
168
vacio :: M.MultiSet a vacio = M.empty
37
vacio = M.empty
15
true
true
0
6
33
23
14
9
null
null
d0kt0r0/Tidal
src/Sound/Tidal/old/Stream.hs
gpl-3.0
(***) = foldl (|*|)
19
(***) = foldl (|*|)
19
(***) = foldl (|*|)
19
false
false
1
5
3
16
8
8
null
null
BartAdv/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v LStrEq [l,r] = v ++ "idris_streq(vm, " ++ creg l ++ ", " ++ creg r ++ ")"
80
doOp v LStrEq [l,r] = v ++ "idris_streq(vm, " ++ creg l ++ ", " ++ creg r ++ ")"
80
doOp v LStrEq [l,r] = v ++ "idris_streq(vm, " ++ creg l ++ ", " ++ creg r ++ ")"
80
false
false
0
9
19
45
22
23
null
null
mmhat/h-gpgme
src/Crypto/Gpgme/Ctx.hs
mit
withCtx :: String -- ^ path to gpg homedirectory -> String -- ^ locale -> Protocol -- ^ protocol -> (Ctx -> IO a) -- ^ action to be run with ctx -> IO a withCtx homedir localeStr prot f = do ctx <- newCtx homedir localeStr prot catch ( do res <- f...
683
withCtx :: String -- ^ path to gpg homedirectory -> String -- ^ locale -> Protocol -- ^ protocol -> (Ctx -> IO a) -- ^ action to be run with ctx -> IO a withCtx homedir localeStr prot f = do ctx <- newCtx homedir localeStr prot catch ( do res <- f...
683
withCtx homedir localeStr prot f = do ctx <- newCtx homedir localeStr prot catch ( do res <- f ctx freeCtx ctx return res ) -- If an exception occurs, first free the GPG context -- and then throw our own exception to signal that -- the exception was caught a...
479
false
true
0
15
249
140
68
72
null
null
yi-editor/yi
yi-core/src/Yi/Paths.hs
gpl-2.0
getDataDir ::(MonadBase IO m) => m FilePath getDataDir = appUserDataCond XDG.getUserDataDir
91
getDataDir ::(MonadBase IO m) => m FilePath getDataDir = appUserDataCond XDG.getUserDataDir
91
getDataDir = appUserDataCond XDG.getUserDataDir
47
false
true
0
6
10
30
15
15
null
null
nevrenato/HyLoRes_Source
src/HyLoRes/Core/Rule/Definitions.hs
gpl-2.0
prop_emptyness_parEq :: NomSym -> (Formula Nom, BasicClause) -> (Formula Nom, [Formula (At Nom)]) -> Bool prop_emptyness_parEq i (j,c) (k,d) = testEmptynessBin main side (runB parEqRule) where main = (at i j, c) side = (at i k, fromList d)
316
prop_emptyness_parEq :: NomSym -> (Formula Nom, BasicClause) -> (Formula Nom, [Formula (At Nom)]) -> Bool prop_emptyness_parEq i (j,c) (k,d) = testEmptynessBin main side (runB parEqRule) where main = (at i j, c) side = (at i k, fromList d)
316
prop_emptyness_parEq i (j,c) (k,d) = testEmptynessBin main side (runB parEqRule) where main = (at i j, c) side = (at i k, fromList d)
147
false
true
2
13
115
135
66
69
null
null
doylew/practice
haskell/test.hs
mit
sum' (x:xs) = x + sum xs
24
sum' (x:xs) = x + sum xs
24
sum' (x:xs) = x + sum xs
24
false
false
2
6
6
26
11
15
null
null
ktvoelker/auth-proxy
src/Authenticate.hs
bsd-3-clause
verify :: M Success verify = do args <- view $ request . to queryString actualToken <- case decodeUtf8 <$> join (lookup "token" args) of Nothing -> throwError $ Error BadRequest "Missing token." Just token -> return token (expectedToken, unverifiedEmail, redirect) <- use Session.unverifiedEmail >>= \case ...
669
verify :: M Success verify = do args <- view $ request . to queryString actualToken <- case decodeUtf8 <$> join (lookup "token" args) of Nothing -> throwError $ Error BadRequest "Missing token." Just token -> return token (expectedToken, unverifiedEmail, redirect) <- use Session.unverifiedEmail >>= \case ...
669
verify = do args <- view $ request . to queryString actualToken <- case decodeUtf8 <$> join (lookup "token" args) of Nothing -> throwError $ Error BadRequest "Missing token." Just token -> return token (expectedToken, unverifiedEmail, redirect) <- use Session.unverifiedEmail >>= \case Nothing -> throw...
649
false
true
0
14
121
216
96
120
null
null
acowley/ghc
compiler/types/Type.hs
bsd-3-clause
typeRepArity n ty = case repType ty of UnaryRep (FunTy ty1 ty2) -> length (flattenRepType (repType ty1)) + typeRepArity (n - 1) ty2 _ -> pprPanic "typeRepArity: arity greater than type can handle" (ppr (n, ty))
237
typeRepArity n ty = case repType ty of UnaryRep (FunTy ty1 ty2) -> length (flattenRepType (repType ty1)) + typeRepArity (n - 1) ty2 _ -> pprPanic "typeRepArity: arity greater than type can handle" (ppr (n, ty))
237
typeRepArity n ty = case repType ty of UnaryRep (FunTy ty1 ty2) -> length (flattenRepType (repType ty1)) + typeRepArity (n - 1) ty2 _ -> pprPanic "typeRepArity: arity greater than type can handle" (ppr (n, ty))
237
false
false
1
13
62
93
43
50
null
null
r-peck/Rome
src/Lib.hs
mit
filterAccordingToListMode :: ListMode -> [PlatformAvailability] -> [PlatformAvailability] filterAccordingToListMode All = id
124
filterAccordingToListMode :: ListMode -> [PlatformAvailability] -> [PlatformAvailability] filterAccordingToListMode All = id
124
filterAccordingToListMode All = id
34
false
true
0
7
10
28
15
13
null
null
byorgey/Idris-dev
src/Core/ProofState.hs
bsd-3-clause
getName :: Monad m => String -> StateT TState m Name getName tag = do ps <- get let n = nextname ps put (ps { nextname = n+1 }) return $ MN n tag
196
getName :: Monad m => String -> StateT TState m Name getName tag = do ps <- get let n = nextname ps put (ps { nextname = n+1 }) return $ MN n tag
196
getName tag = do ps <- get let n = nextname ps put (ps { nextname = n+1 }) return $ MN n tag
143
false
true
0
11
85
84
39
45
null
null
mpickering/HaRe
old/testing/asPatterns/A5.hs
bsd-3-clause
insert val (T tval left right) | val > tval = T tval left (insert val right) | otherwise = T tval (insert val left) right
127
insert val (T tval left right) | val > tval = T tval left (insert val right) | otherwise = T tval (insert val left) right
127
insert val (T tval left right) | val > tval = T tval left (insert val right) | otherwise = T tval (insert val left) right
127
false
false
0
8
31
76
33
43
null
null
chwthewke/horbits
src/horbits/Horbits/Body/Data.hs
bsd-3-clause
getColor Polta = Just $ RgbaColor 0.482350 0.623530 0.580390 1.000000
70
getColor Polta = Just $ RgbaColor 0.482350 0.623530 0.580390 1.000000
70
getColor Polta = Just $ RgbaColor 0.482350 0.623530 0.580390 1.000000
70
false
false
0
6
10
22
10
12
null
null
twittner/cql-io
src/Database/CQL/IO/Pool.hs
mpl-2.0
put :: Pool -> Stripe -> Resource -> (Resource -> Resource) -> IO () put p s r f = do now <- p^.currentTime let updated x = f x { tstamp = now, refcnt = refcnt x - 1 } atomically $ do rs <- readTVar (conns s) let (xs, rr) = Seq.breakl ((value r ==) . value) rs case Seq.viewl rr of ...
457
put :: Pool -> Stripe -> Resource -> (Resource -> Resource) -> IO () put p s r f = do now <- p^.currentTime let updated x = f x { tstamp = now, refcnt = refcnt x - 1 } atomically $ do rs <- readTVar (conns s) let (xs, rr) = Seq.breakl ((value r ==) . value) rs case Seq.viewl rr of ...
457
put p s r f = do now <- p^.currentTime let updated x = f x { tstamp = now, refcnt = refcnt x - 1 } atomically $ do rs <- readTVar (conns s) let (xs, rr) = Seq.breakl ((value r ==) . value) rs case Seq.viewl rr of EmptyL -> writeTVar (conns s) $! xs |> updated r ...
388
false
true
0
18
156
235
112
123
null
null
siddhanathan/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
isVecExpr (CmmMachOp (MO_VF_Extract {}) _) = True
49
isVecExpr (CmmMachOp (MO_VF_Extract {}) _) = True
49
isVecExpr (CmmMachOp (MO_VF_Extract {}) _) = True
49
false
false
0
9
6
24
12
12
null
null
ssaavedra/liquidhaskell
tests/pos/Books.hs
bsd-3-clause
{-@ inline discount @-} discount :: Int -> Int discount bookCount = (bookCount - BOOK_THRESHOLD) * DISCOUNT_PERCENTAGE
118
discount :: Int -> Int discount bookCount = (bookCount - BOOK_THRESHOLD) * DISCOUNT_PERCENTAGE
94
discount bookCount = (bookCount - BOOK_THRESHOLD) * DISCOUNT_PERCENTAGE
71
true
true
0
7
16
36
17
19
null
null
kishoredbn/barrelfish
hake/RuleDefs.hs
mit
-- manually add dependencies for now (it would be better if each library -- defined each own dependencies locally, but that does not seem to be an -- easy thing to do currently libposixcompat_deps = LibDeps [ LibDep "posixcompat", (libvfs_deps_all "vfs"), LibDep "term_server" ]
314
libposixcompat_deps = LibDeps [ LibDep "posixcompat", (libvfs_deps_all "vfs"), LibDep "term_server" ]
137
libposixcompat_deps = LibDeps [ LibDep "posixcompat", (libvfs_deps_all "vfs"), LibDep "term_server" ]
137
true
false
0
8
79
33
18
15
null
null
uduki/hsQt
Qtc/Gui/QDirModel.hs
bsd-2-clause
qDirModel_delete :: QDirModel a -> IO () qDirModel_delete x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QDirModel_delete cobj_x0
128
qDirModel_delete :: QDirModel a -> IO () qDirModel_delete x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QDirModel_delete cobj_x0
128
qDirModel_delete x0 = withObjectPtr x0 $ \cobj_x0 -> qtc_QDirModel_delete cobj_x0
87
false
true
2
8
22
47
20
27
null
null
ezyang/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
isMetaTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] = ASSERT2( tcIsTcTyVar tv, ppr tv ) case tcTyVarDetails tv of MetaTv {} -> True _ -> False | otherwise = False
228
isMetaTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] = ASSERT2( tcIsTcTyVar tv, ppr tv ) case tcTyVarDetails tv of MetaTv {} -> True _ -> False | otherwise = False
228
isMetaTyVar tv | isTyVar tv -- See Note [Coercion variables in free variable lists] = ASSERT2( tcIsTcTyVar tv, ppr tv ) case tcTyVarDetails tv of MetaTv {} -> True _ -> False | otherwise = False
228
false
false
0
8
69
75
33
42
null
null
chanind/haskell-99-problems
Problem9Spec.hs
mit
spec :: Spec spec = do describe "groupDuplicates" $ do it "should group duplicates into sublists" $ groupDuplicates [1,1,2,4,4,1] `shouldBe` [[1,1], [2], [4,4], [1]] it "should work on strings too" $ groupDuplicates "aaaabccaadeeee" `shouldBe` ["aaaa","b","cc","aa","d","eeee...
322
spec :: Spec spec = do describe "groupDuplicates" $ do it "should group duplicates into sublists" $ groupDuplicates [1,1,2,4,4,1] `shouldBe` [[1,1], [2], [4,4], [1]] it "should work on strings too" $ groupDuplicates "aaaabccaadeeee" `shouldBe` ["aaaa","b","cc","aa","d","eeee...
322
spec = do describe "groupDuplicates" $ do it "should group duplicates into sublists" $ groupDuplicates [1,1,2,4,4,1] `shouldBe` [[1,1], [2], [4,4], [1]] it "should work on strings too" $ groupDuplicates "aaaabccaadeeee" `shouldBe` ["aaaa","b","cc","aa","d","eeee"]
309
false
true
0
13
79
132
73
59
null
null
stevely/hspirv
src/SpirV/Builder/Raw.hs
bsd-3-clause
-- Id 1: Result type, must be same type as both operands -- Id 2: Condition to select upon, must be boolean type -- Id 3: First operand -- Id 4: Second operand select :: Id -> Id -> Id -> Id -> Builder Id select t c v1 v2 = do i <- genId writeInstruction (addOpInstruction (OpSelect t i c v1 v2)) return i -...
408
select :: Id -> Id -> Id -> Id -> Builder Id select t c v1 v2 = do i <- genId writeInstruction (addOpInstruction (OpSelect t i c v1 v2)) return i -- Id 1: Result type, must be boolean type -- Id 2: First operand -- Id 3: Second operand
248
select t c v1 v2 = do i <- genId writeInstruction (addOpInstruction (OpSelect t i c v1 v2)) return i -- Id 1: Result type, must be boolean type -- Id 2: First operand -- Id 3: Second operand
203
true
true
0
11
96
85
43
42
null
null
randen/haddock
haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
bsd-2-clause
punctuate :: Html -> [Html] -> [Html] punctuate _ [] = []
61
punctuate :: Html -> [Html] -> [Html] punctuate _ [] = []
61
punctuate _ [] = []
23
false
true
0
9
15
40
19
21
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Advertisers/Get.hs
mpl-2.0
-- | User profile ID associated with this request. advProFileId :: Lens' AdvertisersGet Int64 advProFileId = lens _advProFileId (\ s a -> s{_advProFileId = a}) . _Coerce
177
advProFileId :: Lens' AdvertisersGet Int64 advProFileId = lens _advProFileId (\ s a -> s{_advProFileId = a}) . _Coerce
126
advProFileId = lens _advProFileId (\ s a -> s{_advProFileId = a}) . _Coerce
83
true
true
0
10
34
46
24
22
null
null
rleshchinskiy/vector
Data/Vector.hs
bsd-3-clause
concatMap = G.concatMap
23
concatMap = G.concatMap
23
concatMap = G.concatMap
23
false
false
0
5
2
8
4
4
null
null
nushio3/ghc
compiler/deSugar/DsBinds.hs
bsd-3-clause
dsSpecs poly_rhs (SpecPrags sps) = do { pairs <- mapMaybeM (dsSpec (Just poly_rhs)) sps ; let (spec_binds_s, rules) = unzip pairs ; return (concatOL spec_binds_s, rules) }
187
dsSpecs poly_rhs (SpecPrags sps) = do { pairs <- mapMaybeM (dsSpec (Just poly_rhs)) sps ; let (spec_binds_s, rules) = unzip pairs ; return (concatOL spec_binds_s, rules) }
187
dsSpecs poly_rhs (SpecPrags sps) = do { pairs <- mapMaybeM (dsSpec (Just poly_rhs)) sps ; let (spec_binds_s, rules) = unzip pairs ; return (concatOL spec_binds_s, rules) }
187
false
false
0
12
42
81
39
42
null
null
ocramz/optimization
src/Optimization/Constrained/Penalty.hs
bsd-3-clause
minimize :: (Functor f, RealFrac a, Ord a, g ~ V) => (FU f a -> f a -> [f a]) -- ^ Primal minimizer -> Opt f a -- ^ The optimization problem of interest -> a -- ^ The penalty increase factor -> f a -- ^ The primal s...
684
minimize :: (Functor f, RealFrac a, Ord a, g ~ V) => (FU f a -> f a -> [f a]) -- ^ Primal minimizer -> Opt f a -- ^ The optimization problem of interest -> a -- ^ The penalty increase factor -> f a -- ^ The primal s...
638
minimize minX opt alpha = go where go x0 l0 = let l1 = fmap (*alpha) l0 x1 = head $ drop 100 $ minX (FU $ \x -> augLagrangian opt x (fmap realToFrac l1)) x0 in x1 : go x1 l1
218
true
true
0
16
322
204
103
101
null
null
mcschroeder/ghc
compiler/prelude/PrelRules.hs
bsd-3-clause
strengthReduction :: Literal -> PrimOp -> RuleM CoreExpr strengthReduction two_lit add_op = do -- Note [Strength reduction] arg <- msum [ do [arg, Lit mult_lit] <- getArgs guard (mult_lit == two_lit) return arg , do [Lit mult_lit, arg] <- getArgs ...
1,091
strengthReduction :: Literal -> PrimOp -> RuleM CoreExpr strengthReduction two_lit add_op = do -- Note [Strength reduction] arg <- msum [ do [arg, Lit mult_lit] <- getArgs guard (mult_lit == two_lit) return arg , do [Lit mult_lit, arg] <- getArgs ...
1,091
strengthReduction two_lit add_op = do -- Note [Strength reduction] arg <- msum [ do [arg, Lit mult_lit] <- getArgs guard (mult_lit == two_lit) return arg , do [Lit mult_lit, arg] <- getArgs guard (mult_lit == two_lit) return arg...
1,034
false
true
0
14
261
157
84
73
null
null
NicolasDP/hs-packer
Data/Packer/Internal.hs
bsd-2-clause
-- | Get the position in the memory block. packGetPosition :: Packing Int packGetPosition = Packing $ \(iniPtr, _) mem@(MemView ptr _) -> return (ptr `minusPtr` iniPtr, mem)
173
packGetPosition :: Packing Int packGetPosition = Packing $ \(iniPtr, _) mem@(MemView ptr _) -> return (ptr `minusPtr` iniPtr, mem)
130
packGetPosition = Packing $ \(iniPtr, _) mem@(MemView ptr _) -> return (ptr `minusPtr` iniPtr, mem)
99
true
true
0
9
27
58
33
25
null
null
yamadapc/hzulip
src/Web/HZulip.hs
gpl-2.0
-- | -- Flipped version of 'runZulip' withZulip :: ZulipOptions -> ZulipM a -> IO a withZulip = flip runZulip
109
withZulip :: ZulipOptions -> ZulipM a -> IO a withZulip = flip runZulip
71
withZulip = flip runZulip
25
true
true
0
7
19
30
15
15
null
null
dalaing/sdl2
src/SDL/Video/Renderer.hs
bsd-3-clause
-- | Obtain the pointer to the underlying pixels in a surface. You should bracket -- this call with 'lockSurface' and 'unlockSurface', respectively. surfacePixels :: MonadIO m => Surface -> m (Ptr ()) surfacePixels (Surface s _) = liftIO $ Raw.surfacePixels <$> peek s
268
surfacePixels :: MonadIO m => Surface -> m (Ptr ()) surfacePixels (Surface s _) = liftIO $ Raw.surfacePixels <$> peek s
119
surfacePixels (Surface s _) = liftIO $ Raw.surfacePixels <$> peek s
67
true
true
0
10
43
63
30
33
null
null
tamarin-prover/tamarin-prover
lib/theory/src/Theory/Constraint/Solver/ProofMethod.hs
gpl-3.0
prettyDiffProofMethod :: HighlightDocument d => DiffProofMethod -> d prettyDiffProofMethod method = case method of DiffMirrored -> keyword_ "MIRRORED" DiffAttack -> keyword_ "ATTACK" <-> lineComment_ "trace found" DiffSorry reason -> fsep [keyword_ "sorry", maybe em...
634
prettyDiffProofMethod :: HighlightDocument d => DiffProofMethod -> d prettyDiffProofMethod method = case method of DiffMirrored -> keyword_ "MIRRORED" DiffAttack -> keyword_ "ATTACK" <-> lineComment_ "trace found" DiffSorry reason -> fsep [keyword_ "sorry", maybe em...
634
prettyDiffProofMethod method = case method of DiffMirrored -> keyword_ "MIRRORED" DiffAttack -> keyword_ "ATTACK" <-> lineComment_ "trace found" DiffSorry reason -> fsep [keyword_ "sorry", maybe emptyDoc lineComment_ reason] -- MERGED with solved. -- DiffTrivial ...
565
false
true
0
10
158
131
60
71
null
null
TomMD/cryptol
src/Cryptol/TypeCheck/Solver/Eval.hs
bsd-3-clause
fromNat' (Nat x) = tNum x
25
fromNat' (Nat x) = tNum x
25
fromNat' (Nat x) = tNum x
25
false
false
0
6
5
19
8
11
null
null
green-haskell/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
getRegister' _ is32Bit (CmmMachOp (MO_Add W64) [CmmReg (CmmGlobal PicBaseReg), CmmLit displacement]) | not is32Bit = do return $ Any II64 (\dst -> unitOL $ LEA II64 (OpAddr (ripRel (litToImm displacement))) (OpReg dst))
271
getRegister' _ is32Bit (CmmMachOp (MO_Add W64) [CmmReg (CmmGlobal PicBaseReg), CmmLit displacement]) | not is32Bit = do return $ Any II64 (\dst -> unitOL $ LEA II64 (OpAddr (ripRel (litToImm displacement))) (OpReg dst))
271
getRegister' _ is32Bit (CmmMachOp (MO_Add W64) [CmmReg (CmmGlobal PicBaseReg), CmmLit displacement]) | not is32Bit = do return $ Any II64 (\dst -> unitOL $ LEA II64 (OpAddr (ripRel (litToImm displacement))) (OpReg dst))
271
false
false
0
19
83
109
52
57
null
null
massudaw/mtk
example/Sample1.hs
bsd-3-clause
se2 = measure he1 re1 ye1 se1
29
se2 = measure he1 re1 ye1 se1
29
se2 = measure he1 re1 ye1 se1
29
false
false
1
5
6
18
7
11
null
null
diku-dk/futhark
src/Futhark/Pass/ExtractKernels.hs
isc
transformStm path (Let pat aux@(StmAux cs _ _) (Op (Stream w arrs (Parallel o comm red_fun) nes fold_fun))) | "sequential_inner" `inAttrs` stmAuxAttrs aux = paralleliseOuter path | otherwise = do ((outer_suff, outer_suff_key), suff_stms) <- sufficientParallelism "suff_outer_stream" [w] path Nothing ...
2,444
transformStm path (Let pat aux@(StmAux cs _ _) (Op (Stream w arrs (Parallel o comm red_fun) nes fold_fun))) | "sequential_inner" `inAttrs` stmAuxAttrs aux = paralleliseOuter path | otherwise = do ((outer_suff, outer_suff_key), suff_stms) <- sufficientParallelism "suff_outer_stream" [w] path Nothing ...
2,444
transformStm path (Let pat aux@(StmAux cs _ _) (Op (Stream w arrs (Parallel o comm red_fun) nes fold_fun))) | "sequential_inner" `inAttrs` stmAuxAttrs aux = paralleliseOuter path | otherwise = do ((outer_suff, outer_suff_key), suff_stms) <- sufficientParallelism "suff_outer_stream" [w] path Nothing ...
2,444
false
false
10
16
789
661
318
343
null
null
matthieu/witty
haskell/src/types.hs
apache-2.0
wyPlus (WyFloat f1) (WyFloat f2) = return $ WyFloat (f1 + f2)
61
wyPlus (WyFloat f1) (WyFloat f2) = return $ WyFloat (f1 + f2)
61
wyPlus (WyFloat f1) (WyFloat f2) = return $ WyFloat (f1 + f2)
61
false
false
0
8
11
39
18
21
null
null
Martoon-00/toy-compiler
src/Toy/Exp/Operations.hs
bsd-3-clause
binOp "/" = quot
17
binOp "/" = quot
17
binOp "/" = quot
17
false
false
1
5
4
13
4
9
null
null
dcousens/RayTracer
Tracer.hs
mit
spheres :: [Vector3 Double] spheres = map fst $ filter snd $ zip sphereGrid sphereMask where fPos j k = Vector3 (fromIntegral $ -k) 0 ((fromIntegral $ -j) - 4) sphereGrid = [fPos j k | j <- [0 .. length logoBitMask], k <- [0 .. 32]] sphereMask = map (\x -> x > 0) [((.&.) b $ sh...
379
spheres :: [Vector3 Double] spheres = map fst $ filter snd $ zip sphereGrid sphereMask where fPos j k = Vector3 (fromIntegral $ -k) 0 ((fromIntegral $ -j) - 4) sphereGrid = [fPos j k | j <- [0 .. length logoBitMask], k <- [0 .. 32]] sphereMask = map (\x -> x > 0) [((.&.) b $ sh...
379
spheres = map fst $ filter snd $ zip sphereGrid sphereMask where fPos j k = Vector3 (fromIntegral $ -k) 0 ((fromIntegral $ -j) - 4) sphereGrid = [fPos j k | j <- [0 .. length logoBitMask], k <- [0 .. 32]] sphereMask = map (\x -> x > 0) [((.&.) b $ shiftL 1 k) | b <- logoBitMask...
351
false
true
0
12
115
189
100
89
null
null
michaelt/series
Series/Prelude.hs
bsd-3-clause
-- --------------- -- iterate -- --------------- iterate :: (a -> a) -> a -> Series (Of a) m r iterate f = buildSeries . F.iterate f
134
iterate :: (a -> a) -> a -> Series (Of a) m r iterate f = buildSeries . F.iterate f
84
iterate f = buildSeries . F.iterate f
38
true
true
0
9
27
54
28
26
null
null
nadavshemer/buildsome
src/Buildsome/CompatMakefile.hs
gpl-2.0
onMultipleTargets :: Phonies -> FilePath -> Stats -> [Target] -> M [ByteString] onMultipleTargets phoniesSet cwd stats = fmap concat . mapM (onOneTarget phoniesSet cwd stats)
174
onMultipleTargets :: Phonies -> FilePath -> Stats -> [Target] -> M [ByteString] onMultipleTargets phoniesSet cwd stats = fmap concat . mapM (onOneTarget phoniesSet cwd stats)
174
onMultipleTargets phoniesSet cwd stats = fmap concat . mapM (onOneTarget phoniesSet cwd stats)
94
false
true
0
10
24
67
32
35
null
null
toonn/wyah
src/TACheck.hs
bsd-2-clause
check :: Expr -> Either TypeError Type check = runExcept . typeof
65
check :: Expr -> Either TypeError Type check = runExcept . typeof
65
check = runExcept . typeof
26
false
true
1
7
11
31
13
18
null
null
robrene/robdd-with-template-hs
test/BoolExpr/UnitTests/BoolExpr.hs
bsd-3-clause
testEvalOneAndOne :: Test testEvalOneAndOne = evalCase True $ one ∧ one
71
testEvalOneAndOne :: Test testEvalOneAndOne = evalCase True $ one ∧ one
71
testEvalOneAndOne = evalCase True $ one ∧ one
45
false
true
0
7
10
22
11
11
null
null
hvr/jhc
src/Grin/Show.hs
mit
isOneLine MkCont {} = False
27
isOneLine MkCont {} = False
27
isOneLine MkCont {} = False
27
false
false
0
6
4
13
6
7
null
null
vedgar/mlr
Haskell/L1r.hs
unlicense
containsBelow' n (Single v) = maxIndex'' v <= n
47
containsBelow' n (Single v) = maxIndex'' v <= n
47
containsBelow' n (Single v) = maxIndex'' v <= n
47
false
false
0
7
8
24
11
13
null
null
coreyoconnor/bind-marshal
test/verify_desaction_dynamic_fixed_buffer.hs
bsd-3-clause
validate_t_0 :: BytePtr -> Test TestResult validate_t_0 buffer_0 = verify "deserializes an arbitrary number of units" $ \ (Max1KBInt i) -> liftIOResult $ do validate_t_0_inner buffer_0 i
201
validate_t_0 :: BytePtr -> Test TestResult validate_t_0 buffer_0 = verify "deserializes an arbitrary number of units" $ \ (Max1KBInt i) -> liftIOResult $ do validate_t_0_inner buffer_0 i
201
validate_t_0 buffer_0 = verify "deserializes an arbitrary number of units" $ \ (Max1KBInt i) -> liftIOResult $ do validate_t_0_inner buffer_0 i
158
false
true
0
10
41
51
24
27
null
null
fmthoma/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
pprCtO IfOrigin = ptext (sLit "an if statement")
61
pprCtO IfOrigin = ptext (sLit "an if statement")
61
pprCtO IfOrigin = ptext (sLit "an if statement")
61
false
false
0
7
20
19
8
11
null
null
afiskon/JuicyPixels-canvas
src/Codec/Picture/Canvas.hs
bsd-2-clause
imageToCanvas :: Pixel a => Image a -> Either String (Canvas a) imageToCanvas img | w > maxWH = err "width" | h > maxWH = err "height" | otherwise = Right Canvas { canvasWidth = w, canvasHeight = h, pixels = M.fromList [(makeKey x y, pixelAt img x y) | x <- [0..w-...
535
imageToCanvas :: Pixel a => Image a -> Either String (Canvas a) imageToCanvas img | w > maxWH = err "width" | h > maxWH = err "height" | otherwise = Right Canvas { canvasWidth = w, canvasHeight = h, pixels = M.fromList [(makeKey x y, pixelAt img x y) | x <- [0..w-...
535
imageToCanvas img | w > maxWH = err "width" | h > maxWH = err "height" | otherwise = Right Canvas { canvasWidth = w, canvasHeight = h, pixels = M.fromList [(makeKey x y, pixelAt img x y) | x <- [0..w-1], y <- [0..h-1]] } where w = imageWidth im...
471
false
true
0
14
185
206
102
104
null
null
ssaavedra/liquidhaskell
benchmarks/esop2013-submission/Splay.hs
bsd-3-clause
member :: Ord a => a -> Splay a -> (Bool, Splay a) member x t = case split x t of (l,True,r) -> (True, Node x l r) (Leaf,_,r) -> (False, r) (l,_,Leaf) -> (False, l) (l,_,r) -> let (m,l') = deleteMax l in (False, Node m l' r) ---------------------------------------------------------...
490
member :: Ord a => a -> Splay a -> (Bool, Splay a) member x t = case split x t of (l,True,r) -> (True, Node x l r) (Leaf,_,r) -> (False, r) (l,_,Leaf) -> (False, l) (l,_,r) -> let (m,l') = deleteMax l in (False, Node m l' r) ---------------------------------------------------------...
490
member x t = case split x t of (l,True,r) -> (True, Node x l r) (Leaf,_,r) -> (False, r) (l,_,Leaf) -> (False, l) (l,_,r) -> let (m,l') = deleteMax l in (False, Node m l' r) ---------------------------------------------------------------- {-| Finding the minimum element. >>> fst ...
439
false
true
0
12
119
174
96
78
null
null
RichCreameryButter/my-xmonad-ubuntu-conf
xmonad.hs
mit
numKeys = [ xK_7 , xK_8 , xK_9 , xK_4 , xK_5 , xK_6 , xK_1 , xK_2 , xK_3 , xK_0 , xK_minus , xK_equal ]
185
numKeys = [ xK_7 , xK_8 , xK_9 , xK_4 , xK_5 , xK_6 , xK_1 , xK_2 , xK_3 , xK_0 , xK_minus , xK_equal ]
185
numKeys = [ xK_7 , xK_8 , xK_9 , xK_4 , xK_5 , xK_6 , xK_1 , xK_2 , xK_3 , xK_0 , xK_minus , xK_equal ]
185
false
false
1
5
108
45
27
18
null
null
bennofs/cabal2nix
src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs
bsd-3-clause
libNixName "gdk-2.0" = return "gtk2"
63
libNixName "gdk-2.0" = return "gtk2"
63
libNixName "gdk-2.0" = return "gtk2"
63
false
false
0
5
31
13
5
8
null
null
Rathcke/uni
ap/exam/src/subs/SubsParser.hs
gpl-3.0
parseFile :: FilePath -> IO (Either ParseError Program) parseFile path = fmap parseString $ readFile path
105
parseFile :: FilePath -> IO (Either ParseError Program) parseFile path = fmap parseString $ readFile path
105
parseFile path = fmap parseString $ readFile path
49
false
true
0
9
15
43
19
24
null
null
urbanslug/ghc
compiler/codeGen/StgCmmClosure.hs
bsd-3-clause
isToplevClosure :: ClosureInfo -> Bool isToplevClosure (ClosureInfo { closureLFInfo = lf_info }) = case lf_info of LFReEntrant TopLevel _ _ _ -> True LFThunk TopLevel _ _ _ _ -> True _other -> False -------------------------------------- -- Label generation -------------...
345
isToplevClosure :: ClosureInfo -> Bool isToplevClosure (ClosureInfo { closureLFInfo = lf_info }) = case lf_info of LFReEntrant TopLevel _ _ _ -> True LFThunk TopLevel _ _ _ _ -> True _other -> False -------------------------------------- -- Label generation -------------...
345
isToplevClosure (ClosureInfo { closureLFInfo = lf_info }) = case lf_info of LFReEntrant TopLevel _ _ _ -> True LFThunk TopLevel _ _ _ _ -> True _other -> False -------------------------------------- -- Label generation --------------------------------------
306
false
true
0
8
87
80
40
40
null
null
ghc-android/ghc
testsuite/tests/typecheck/should_fail/tcfail114.hs
bsd-3-clause
test :: Bar test = undefined { foo = () }
41
test :: Bar test = undefined { foo = () }
41
test = undefined { foo = () }
29
false
true
0
8
10
31
14
17
null
null
silky/Tidal
Sound/Tidal/Strategies.hs
gpl-3.0
quad = stutter 4
18
quad = stutter 4
18
quad = stutter 4
18
false
false
1
5
5
13
4
9
null
null
kmate/HaRe
old/testing/unfoldAsPatterns/D2_TokOut.hs
bsd-3-clause
newPat_1 = Empty
16
newPat_1 = Empty
16
newPat_1 = Empty
16
false
false
0
4
2
6
3
3
null
null
piyush-kurur/yesod
yesod-test/Yesod/Test/CssQuery.hs
mit
directChildren :: Parser SelectorGroup directChildren = do _ <- char '>' _ <- char ' ' sels <- selectors _ <- optional $ char ' ' return $ DirectChildren sels
168
directChildren :: Parser SelectorGroup directChildren = do _ <- char '>' _ <- char ' ' sels <- selectors _ <- optional $ char ' ' return $ DirectChildren sels
168
directChildren = do _ <- char '>' _ <- char ' ' sels <- selectors _ <- optional $ char ' ' return $ DirectChildren sels
129
false
true
0
9
39
65
28
37
null
null
GaloisInc/network-hans
src/Network/Socket/Internal.hs
bsd-3-clause
-- | Throw an 'IOError' corresponding to the current socket error if -- the IO action returns a result of @-1@, but retries in case of an -- interrupted operation. throwSocketErrorIfMinus1Retry :: (Eq a, Num a) => String -- ^ textual description of the location -> IO a -- ^ the 'IO' operation to be exec...
392
throwSocketErrorIfMinus1Retry :: (Eq a, Num a) => String -- ^ textual description of the location -> IO a -- ^ the 'IO' operation to be executed -> IO a throwSocketErrorIfMinus1Retry = throwErrnoIfMinus1Retry
228
throwSocketErrorIfMinus1Retry = throwErrnoIfMinus1Retry
55
true
true
0
9
81
51
26
25
null
null
jberryman/wai
wai-frontend-monadcgi/Network/Wai/Frontend/MonadCGI.hs
mit
fixVarNameChar c = toUpper c
28
fixVarNameChar c = toUpper c
28
fixVarNameChar c = toUpper c
28
false
false
1
5
4
16
5
11
null
null
davmre/matrizer
src/Matrizer/Analysis.hs
gpl-2.0
sumSizeCheck r1 c1 r2 c2 = (r1 == r2) && (c1 == c2)
51
sumSizeCheck r1 c1 r2 c2 = (r1 == r2) && (c1 == c2)
51
sumSizeCheck r1 c1 r2 c2 = (r1 == r2) && (c1 == c2)
51
false
false
0
7
12
33
17
16
null
null
lih/Epsilon
src/ELisp.hs
bsd-3-clause
eval e = get values >>= \vs -> joined (eval' (snd<$>M.filter ((==Static).fst) vs) e)
86
eval e = get values >>= \vs -> joined (eval' (snd<$>M.filter ((==Static).fst) vs) e)
86
eval e = get values >>= \vs -> joined (eval' (snd<$>M.filter ((==Static).fst) vs) e)
86
false
false
0
15
15
55
28
27
null
null
LeventErkok/hArduino
System/Hardware/Arduino/Parts/LCD.hs
bsd-3-clause
lcdHome :: LCD -> Arduino () lcdHome lcd = withLCD lcd "Sending the cursor home" $ \c -> do sendCmd c LCD_RETURNHOME delay 2 -- | Set the cursor location. The pair of arguments is the new column and row numbers -- respectively: -- -- * The first value is the column, the second is t...
657
lcdHome :: LCD -> Arduino () lcdHome lcd = withLCD lcd "Sending the cursor home" $ \c -> do sendCmd c LCD_RETURNHOME delay 2 -- | Set the cursor location. The pair of arguments is the new column and row numbers -- respectively: -- -- * The first value is the column, the second is t...
657
lcdHome lcd = withLCD lcd "Sending the cursor home" $ \c -> do sendCmd c LCD_RETURNHOME delay 2 -- | Set the cursor location. The pair of arguments is the new column and row numbers -- respectively: -- -- * The first value is the column, the second is the row. (This is counter-intu...
628
false
true
0
9
167
61
33
28
null
null
luisnavarrodelangel/InnerEar
src/InnerEarServer.hs
gpl-3.0
close :: MVar Server -> ConnectionIndex -> String -> IO () close s i msg = do putStrLn $ "closing connection: " ++ msg s' <- takeMVar s sessionEnd i s' putMVar s s' updateServer s $ deleteConnection i return ()
229
close :: MVar Server -> ConnectionIndex -> String -> IO () close s i msg = do putStrLn $ "closing connection: " ++ msg s' <- takeMVar s sessionEnd i s' putMVar s s' updateServer s $ deleteConnection i return ()
228
close s i msg = do putStrLn $ "closing connection: " ++ msg s' <- takeMVar s sessionEnd i s' putMVar s s' updateServer s $ deleteConnection i return ()
169
false
true
0
10
59
101
42
59
null
null
monte-language/masque
Masque/Monte.hs
gpl-3.0
envStack :: Lens' MonteState (NonEmpty Env) envStack f (MS env vat) = (`MS` vat) <$> f env
90
envStack :: Lens' MonteState (NonEmpty Env) envStack f (MS env vat) = (`MS` vat) <$> f env
90
envStack f (MS env vat) = (`MS` vat) <$> f env
46
false
true
0
7
16
48
25
23
null
null
lukexi/animation-pal
test/MainExplosion.hs
bsd-3-clause
main :: IO () main = do vrPal@VRPal{..} <- reacquire 0 $ initVRPal "VRPal" [] -- Set up our cube resources cubeProg <- createShaderProgram "test/cube.vert" "test/cube.frag" cubeGeo <- cubeGeometry (1 :: V3 GLfloat) (V3 1 1 1) shape <- makeShape cubeGeo cubeProg glEnable GL_DEPTH_TEST g...
1,361
main :: IO () main = do vrPal@VRPal{..} <- reacquire 0 $ initVRPal "VRPal" [] -- Set up our cube resources cubeProg <- createShaderProgram "test/cube.vert" "test/cube.frag" cubeGeo <- cubeGeometry (1 :: V3 GLfloat) (V3 1 1 1) shape <- makeShape cubeGeo cubeProg glEnable GL_DEPTH_TEST g...
1,361
main = do vrPal@VRPal{..} <- reacquire 0 $ initVRPal "VRPal" [] -- Set up our cube resources cubeProg <- createShaderProgram "test/cube.vert" "test/cube.frag" cubeGeo <- cubeGeometry (1 :: V3 GLfloat) (V3 1 1 1) shape <- makeShape cubeGeo cubeProg glEnable GL_DEPTH_TEST glClearColor 0 ...
1,347
false
true
0
17
392
404
182
222
null
null
np/lens
src/Control/Lens/Internal/Zipper.hs
bsd-3-clause
-- | Move the 'Zipper' horizontally to the element in the @n@th position in the -- current level, absolutely indexed, starting with the 'farthest' 'leftward' as @0@. -- -- This returns 'Nothing' if the target element doesn't exist. -- -- @'jerkTo' n ≡ 'jerks' 'rightward' n . 'farthest' 'leftward'@ -- -- >>> isNothing $...
753
jerkTo :: MonadPlus m => Int -> (h :> a) -> m (h :> a) jerkTo n z = case compare k n of LT -> jerks rightward (n - k) z EQ -> return z GT -> jerks leftward (k - n) z where k = tooth z
192
jerkTo n z = case compare k n of LT -> jerks rightward (n - k) z EQ -> return z GT -> jerks leftward (k - n) z where k = tooth z
137
true
true
3
10
158
133
71
62
null
null
acowley/pcd-loader
src/PCD/Internal/AsciiParsers.hs
bsd-3-clause
-- |Read point data using a user-supplied ASCII point parser. readPoints :: (G.Vector v a) => Header -> Handle -> ATL.Parser a -> IO (v a) readPoints pcd h p = aux <$> TL.hGetContents h where n = fromIntegral $ pcd^.points aux t0 = G.create $ do v <- GM.new n ...
866
readPoints :: (G.Vector v a) => Header -> Handle -> ATL.Parser a -> IO (v a) readPoints pcd h p = aux <$> TL.hGetContents h where n = fromIntegral $ pcd^.points aux t0 = G.create $ do v <- GM.new n let write = GM.write v go !i !t...
804
readPoints pcd h p = aux <$> TL.hGetContents h where n = fromIntegral $ pcd^.points aux t0 = G.create $ do v <- GM.new n let write = GM.write v go !i !t | i == n = return v | otherwise = case ATL.p...
707
true
true
1
18
425
233
107
126
null
null
mfpi/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs
bsd-3-clause
gl_QUERY_COUNTER_BITS :: GLenum gl_QUERY_COUNTER_BITS = 0x8864
62
gl_QUERY_COUNTER_BITS :: GLenum gl_QUERY_COUNTER_BITS = 0x8864
62
gl_QUERY_COUNTER_BITS = 0x8864
30
false
true
0
4
5
11
6
5
null
null
xmonad/xmonad-contrib
XMonad/Layout/WindowArranger.hs
bsd-3-clause
listFromList :: (b -> c) -> (c -> [a] -> Bool) -> [a] -> [b] -> [b] listFromList f g l = foldr (h l) [] where h x y ys = if g (f y) x then y:ys else ys -- | Given a function to be applied to each member of ta list, and a -- function to check a condition by processing this transformed member -- with something, you ...
389
listFromList :: (b -> c) -> (c -> [a] -> Bool) -> [a] -> [b] -> [b] listFromList f g l = foldr (h l) [] where h x y ys = if g (f y) x then y:ys else ys -- | Given a function to be applied to each member of ta list, and a -- function to check a condition by processing this transformed member -- with something, you ...
389
listFromList f g l = foldr (h l) [] where h x y ys = if g (f y) x then y:ys else ys -- | Given a function to be applied to each member of ta list, and a -- function to check a condition by processing this transformed member -- with something, you get the first member that satisfy the condition, -- or an empty list...
321
false
true
0
10
89
127
65
62
null
null
limaner2002/EPC-tools
USACScripts/src/Scripts/FCCForm500Intake.hs
bsd-3-clause
form500Intake :: Form500Conf -> Appian Value form500Intake conf = do let un = Identifiers $ conf ^.. applicant . username . to AppianUsername --executeActionByName "FCC Form 500" myLandingPageAction1 "FCC Form 500" handleMultipleEntities checkMultiOrgs "Create FCC Form 500" "Billed Entity Name" (conf ^...
2,157
form500Intake :: Form500Conf -> Appian Value form500Intake conf = do let un = Identifiers $ conf ^.. applicant . username . to AppianUsername --executeActionByName "FCC Form 500" myLandingPageAction1 "FCC Form 500" handleMultipleEntities checkMultiOrgs "Create FCC Form 500" "Billed Entity Name" (conf ^...
2,157
form500Intake conf = do let un = Identifiers $ conf ^.. applicant . username . to AppianUsername --executeActionByName "FCC Form 500" myLandingPageAction1 "FCC Form 500" handleMultipleEntities checkMultiOrgs "Create FCC Form 500" "Billed Entity Name" (conf ^. appMultiOrgMethod) --isButton sendU...
2,112
false
true
0
13
389
398
179
219
null
null
sjakobi/brick
programs/LayerDemo.hs
bsd-3-clause
appEvent st _ = M.continue st
29
appEvent st _ = M.continue st
29
appEvent st _ = M.continue st
29
false
false
0
5
5
18
7
11
null
null
michaelschade/hs-stripe
src/Web/Stripe/Customer.hs
bsd-3-clause
getCustomer :: MonadIO m => CustomerId -> StripeT m Customer getCustomer (CustomerId cid) = return . snd =<< query (customerRq [cid])
137
getCustomer :: MonadIO m => CustomerId -> StripeT m Customer getCustomer (CustomerId cid) = return . snd =<< query (customerRq [cid])
137
getCustomer (CustomerId cid) = return . snd =<< query (customerRq [cid])
76
false
true
3
10
24
62
29
33
null
null
kim/amazonka
amazonka-autoscaling/gen/Network/AWS/AutoScaling/Types.hs
mpl-2.0
-- | The types of events for an action to start. ncNotificationType :: Lens' NotificationConfiguration (Maybe Text) ncNotificationType = lens _ncNotificationType (\s a -> s { _ncNotificationType = a })
205
ncNotificationType :: Lens' NotificationConfiguration (Maybe Text) ncNotificationType = lens _ncNotificationType (\s a -> s { _ncNotificationType = a })
156
ncNotificationType = lens _ncNotificationType (\s a -> s { _ncNotificationType = a })
89
true
true
0
9
33
46
25
21
null
null
ajm188/advent_of_code
2016/02/Move.hs
mit
move '2' d = case d of L -> '1' R -> '3' D -> '5' _ -> '2'
94
move '2' d = case d of L -> '1' R -> '3' D -> '5' _ -> '2'
94
move '2' d = case d of L -> '1' R -> '3' D -> '5' _ -> '2'
94
false
false
5
5
54
50
19
31
null
null
fmapfmapfmap/amazonka
amazonka-swf/gen/Network/AWS/SWF/Types/Product.hs
mpl-2.0
-- | If the event is of type 'ChildWorkflowExecutionCanceled' then this -- member is set and provides detailed information about the event. It is -- not set for other event types. heChildWorkflowExecutionCanceledEventAttributes :: Lens' HistoryEvent (Maybe ChildWorkflowExecutionCanceledEventAttributes) heChildWorkflowE...
474
heChildWorkflowExecutionCanceledEventAttributes :: Lens' HistoryEvent (Maybe ChildWorkflowExecutionCanceledEventAttributes) heChildWorkflowExecutionCanceledEventAttributes = lens _heChildWorkflowExecutionCanceledEventAttributes (\ s a -> s{_heChildWorkflowExecutionCanceledEventAttributes = a})
294
heChildWorkflowExecutionCanceledEventAttributes = lens _heChildWorkflowExecutionCanceledEventAttributes (\ s a -> s{_heChildWorkflowExecutionCanceledEventAttributes = a})
170
true
true
0
9
47
48
27
21
null
null
Forkk/ChatCore
ChatCore/Util.hs
mit
-- | Flipped version of evalStateT stateEval :: Monad m => s -> StateT s m a -> m a stateEval = flip evalStateT
111
stateEval :: Monad m => s -> StateT s m a -> m a stateEval = flip evalStateT
76
stateEval = flip evalStateT
27
true
true
0
8
23
40
19
21
null
null
573/leksah
src/IDE/Workspaces.hs
gpl-2.0
workspaceRemovePackage :: IDEPackage -> WorkspaceAction workspaceRemovePackage pack = do ws <- ask when (pack `elem` wsPackages ws) $ lift $ Writer.writeWorkspace ws {wsPackages = delete pack (wsPackages ws)} return ()
239
workspaceRemovePackage :: IDEPackage -> WorkspaceAction workspaceRemovePackage pack = do ws <- ask when (pack `elem` wsPackages ws) $ lift $ Writer.writeWorkspace ws {wsPackages = delete pack (wsPackages ws)} return ()
239
workspaceRemovePackage pack = do ws <- ask when (pack `elem` wsPackages ws) $ lift $ Writer.writeWorkspace ws {wsPackages = delete pack (wsPackages ws)} return ()
183
false
true
0
13
50
83
40
43
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Sed.hs
gpl-2.0
parseRules ("sed","SRegex") = (((pDetectSpaces >>= withAttribute StringTok)) <|> ((pRegExprDynamic "\\\\%1" >>= withAttribute CharTok)) <|> ((pRegExprDynamic "(%1)" >>= withAttribute StringTok) >>~ pushContext ("sed","SReplacement")) <|> ((parseRules ("sed","Regex"))) <|> (currentContext >>= \...
396
parseRules ("sed","SRegex") = (((pDetectSpaces >>= withAttribute StringTok)) <|> ((pRegExprDynamic "\\\\%1" >>= withAttribute CharTok)) <|> ((pRegExprDynamic "(%1)" >>= withAttribute StringTok) >>~ pushContext ("sed","SReplacement")) <|> ((parseRules ("sed","Regex"))) <|> (currentContext >>= \...
396
parseRules ("sed","SRegex") = (((pDetectSpaces >>= withAttribute StringTok)) <|> ((pRegExprDynamic "\\\\%1" >>= withAttribute CharTok)) <|> ((pRegExprDynamic "(%1)" >>= withAttribute StringTok) >>~ pushContext ("sed","SReplacement")) <|> ((parseRules ("sed","Regex"))) <|> (currentContext >>= \...
396
false
false
0
15
64
146
78
68
null
null