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
konn/hint-forked
unit-tests/run-unit-tests.hs
bsd-3-clause
test_priv_syms_in_scope :: TestCase test_priv_syms_in_scope = TestCase "private_syms_in_scope" [mod_file] $ do -- must set to True, otherwise won't work with -- ghc 6.8 set [installedModulesInScope := True] ...
664
test_priv_syms_in_scope :: TestCase test_priv_syms_in_scope = TestCase "private_syms_in_scope" [mod_file] $ do -- must set to True, otherwise won't work with -- ghc 6.8 set [installedModulesInScope := True] ...
664
test_priv_syms_in_scope = TestCase "private_syms_in_scope" [mod_file] $ do -- must set to True, otherwise won't work with -- ghc 6.8 set [installedModulesInScope := True] liftIO $ writeFile mod_fi...
628
false
true
0
10
287
103
51
52
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/signum_1.hs
mit
esEsOrdering LT GT = MyFalse
28
esEsOrdering LT GT = MyFalse
28
esEsOrdering LT GT = MyFalse
28
false
false
1
5
4
16
5
11
null
null
mboeh/wyzrd
src/Main.hs
isc
billy :: Character billy = Character { name = "Billy the Boar" , stats = StatBlock { strength = Attribute 17 , speed = Attribute 50 , grit = Attribute 20 , maxHP = 80 } , condition = Condit...
328
billy :: Character billy = Character { name = "Billy the Boar" , stats = StatBlock { strength = Attribute 17 , speed = Attribute 50 , grit = Attribute 20 , maxHP = 80 } , condition = Condit...
328
billy = Character { name = "Billy the Boar" , stats = StatBlock { strength = Attribute 17 , speed = Attribute 50 , grit = Attribute 20 , maxHP = 80 } , condition = Condition 80 }
309
false
true
0
9
172
69
40
29
null
null
quchen/shaking-up-ghc
src/Rules/IntegerGmp.hs
bsd-3-clause
integerGmpLibrary :: FilePath integerGmpLibrary = integerGmpBase -/- "libgmp.a"
79
integerGmpLibrary :: FilePath integerGmpLibrary = integerGmpBase -/- "libgmp.a"
79
integerGmpLibrary = integerGmpBase -/- "libgmp.a"
49
false
true
0
5
7
15
8
7
null
null
nushio3/ghc
libraries/base/GHC/Show.hs
bsd-3-clause
-- | utility function that surrounds the inner show function with -- parentheses when the 'Bool' parameter is 'True'. showParen :: Bool -> ShowS -> ShowS showParen b p = if b then showChar '(' . p . showChar ')' else p
227
showParen :: Bool -> ShowS -> ShowS showParen b p = if b then showChar '(' . p . showChar ')' else p
109
showParen b p = if b then showChar '(' . p . showChar ')' else p
67
true
true
0
8
50
48
25
23
null
null
bitemyapp/wreq
tests/Properties/Store.hs
bsd-3-clause
fromListSM :: Eq k => Int -> [(k,v)] -> StoreModel k v fromListSM = foldl' (flip (uncurry insertSM)) . emptySM
110
fromListSM :: Eq k => Int -> [(k,v)] -> StoreModel k v fromListSM = foldl' (flip (uncurry insertSM)) . emptySM
110
fromListSM = foldl' (flip (uncurry insertSM)) . emptySM
55
false
true
0
10
19
65
31
34
null
null
phadej/yaml
Data/Yaml/Builder.hs
bsd-2-clause
toSource :: (Monad m, ToYaml a) => a -> Source m Event toSource = mapM_ yield . toEvents . toYaml
97
toSource :: (Monad m, ToYaml a) => a -> Source m Event toSource = mapM_ yield . toEvents . toYaml
97
toSource = mapM_ yield . toEvents . toYaml
42
false
true
0
7
19
46
23
23
null
null
peterokagey/haskellOEIS
src/Sandbox/Sami/Bijection2.hs
apache-2.0
psi k (a'1:a's) (c1@(a1:a2:as):cs) | length c1 == k = (a'1:a2:a's) : psi k (a1:as) cs | length c1 == k + 1 = (a'1:a2:a's) : init (a1:as) : phi k (last as) cs | otherwise = (a'1:a2:a's) : (a1:as) : cs
219
psi k (a'1:a's) (c1@(a1:a2:as):cs) | length c1 == k = (a'1:a2:a's) : psi k (a1:as) cs | length c1 == k + 1 = (a'1:a2:a's) : init (a1:as) : phi k (last as) cs | otherwise = (a'1:a2:a's) : (a1:as) : cs
219
psi k (a'1:a's) (c1@(a1:a2:as):cs) | length c1 == k = (a'1:a2:a's) : psi k (a1:as) cs | length c1 == k + 1 = (a'1:a2:a's) : init (a1:as) : phi k (last as) cs | otherwise = (a'1:a2:a's) : (a1:as) : cs
219
false
false
0
10
61
188
92
96
null
null
gnn/Hets
Driver/WriteLibDefn.hs
gpl-2.0
writeLibDefnLatex :: LogicGraph -> Bool -> GlobalAnnos -> FilePath -> LIB_DEFN -> IO () writeLibDefnLatex lg lbl ga oup = writeFile oup . renderLatex Nothing . toLatexAux (StripComment False) (MkLabel lbl) ga . prettyLG lg
226
writeLibDefnLatex :: LogicGraph -> Bool -> GlobalAnnos -> FilePath -> LIB_DEFN -> IO () writeLibDefnLatex lg lbl ga oup = writeFile oup . renderLatex Nothing . toLatexAux (StripComment False) (MkLabel lbl) ga . prettyLG lg
226
writeLibDefnLatex lg lbl ga oup = writeFile oup . renderLatex Nothing . toLatexAux (StripComment False) (MkLabel lbl) ga . prettyLG lg
136
false
true
1
12
38
87
40
47
null
null
mr/gazelle
src/Network/Gazelle/Types/Gazelle.hs
mit
runRoute :: (FromJSON a, Monad m) => Route -> GazelleT m a runRoute r = GazelleT $ liftF $ RunRoute r id
104
runRoute :: (FromJSON a, Monad m) => Route -> GazelleT m a runRoute r = GazelleT $ liftF $ RunRoute r id
104
runRoute r = GazelleT $ liftF $ RunRoute r id
45
false
true
0
7
21
51
25
26
null
null
AmpersandTarski/ampersand
src/Ampersand/Input/ADL1/Parser.hs
gpl-3.0
pConceptDef :: AmpParser (String->ConceptDef) pConceptDef = Cd <$> currPos <* pKey "CONCEPT" <*> pConceptName <*> (pString <?> "concept definition (string)") <*> (pString `opt` "")
279
pConceptDef :: AmpParser (String->ConceptDef) pConceptDef = Cd <$> currPos <* pKey "CONCEPT" <*> pConceptName <*> (pString <?> "concept definition (string)") <*> (pString `opt` "")
279
pConceptDef = Cd <$> currPos <* pKey "CONCEPT" <*> pConceptName <*> (pString <?> "concept definition (string)") <*> (pString `opt` "")
233
false
true
13
8
122
78
40
38
null
null
zoranbosnjak/deseo
Data/BitString.hs
gpl-3.0
-- | Convert from Bits to list of Bool values unpack :: Bits -> [Bool] unpack = go . shrinkBits where go (BitsNoOffset bs ln) = let bits = mconcat $ fmap unpackWord8 $ BS.unpack bs in P.take ln bits go (BitsWithOffset bs offset ln) = let bits = mconcat $ fmap unpackWord8 $ BS.unpack bs...
440
unpack :: Bits -> [Bool] unpack = go . shrinkBits where go (BitsNoOffset bs ln) = let bits = mconcat $ fmap unpackWord8 $ BS.unpack bs in P.take ln bits go (BitsWithOffset bs offset ln) = let bits = mconcat $ fmap unpackWord8 $ BS.unpack bs in P.take ln $ P.drop offset $ bits ...
394
unpack = go . shrinkBits where go (BitsNoOffset bs ln) = let bits = mconcat $ fmap unpackWord8 $ BS.unpack bs in P.take ln bits go (BitsWithOffset bs offset ln) = let bits = mconcat $ fmap unpackWord8 $ BS.unpack bs in P.take ln $ P.drop offset $ bits go (BitBools lst) = ls...
369
true
true
3
14
127
176
84
92
null
null
michaelt/streaming
src/Streaming/Prelude.hs
bsd-3-clause
{-| Where a transformer returns a stream, run the effects of the stream, keeping the return value. This is usually used at the type > drained :: Monad m => Stream (Of a) m (Stream (Of b) m r) -> Stream (Of a) m r > drained = join . fmap (lift . effects) Here, for example, we split a stream in two places and thr...
844
drained :: (Monad m, Monad (t m), Functor (t m), MonadTrans t) => t m (Stream (Of a) m r) -> t m r drained = join . fmap (lift . effects)
137
drained = join . fmap (lift . effects)
38
true
true
0
11
192
95
48
47
null
null
Jubobs/CommonMark-WIP
src/CommonMark/Parser/Inlines.hs
bsd-3-clause
numericEntity :: Parser Inline numericEntity = do n <- A.char '#' *> value <* semicolon return $ Entity $ T.singleton $ if 0 < n && n <= 0x10FFFF then chr n else replacementChar where value = (xX *> hexadecimal1To8) <|> decimal1To8 xX = A.satisfy (\c -> c == 'x' || c == 'X'...
347
numericEntity :: Parser Inline numericEntity = do n <- A.char '#' *> value <* semicolon return $ Entity $ T.singleton $ if 0 < n && n <= 0x10FFFF then chr n else replacementChar where value = (xX *> hexadecimal1To8) <|> decimal1To8 xX = A.satisfy (\c -> c == 'x' || c == 'X'...
347
numericEntity = do n <- A.char '#' *> value <* semicolon return $ Entity $ T.singleton $ if 0 < n && n <= 0x10FFFF then chr n else replacementChar where value = (xX *> hexadecimal1To8) <|> decimal1To8 xX = A.satisfy (\c -> c == 'x' || c == 'X') -- | Parses a semicolon.
316
false
true
0
11
105
124
63
61
null
null
evanrinehart/broccoli
Control/Broccoli/Eval.hs
bsd-3-clause
prAddSnapEvent :: Progress -> Integer -> E a -> Progress prAddSnapEvent pr name e = pr { prSnapEvents = f (prSnapEvents pr) } where f m = M.insert name (unsafeCoerce e) m -- not type safe but it isn't visible to the client
225
prAddSnapEvent :: Progress -> Integer -> E a -> Progress prAddSnapEvent pr name e = pr { prSnapEvents = f (prSnapEvents pr) } where f m = M.insert name (unsafeCoerce e) m -- not type safe but it isn't visible to the client
225
prAddSnapEvent pr name e = pr { prSnapEvents = f (prSnapEvents pr) } where f m = M.insert name (unsafeCoerce e) m -- not type safe but it isn't visible to the client
168
false
true
0
9
45
75
38
37
null
null
beni55/hscurses
tests/widget-test/TableTest.hs
lgpl-2.1
loop tbw msg = do drawTableWidget tablePos tableSize DHNormal tbw drawTextWidget msgPos msgSize DHNormal msg c <- CursesH.getKey done case c of Curses.KeyChar 'q' -> exitWith ExitSuccess Curses.KeyChar ' ' -> loop (tableWidgetScrollDown tableSize tbw) msg Curses.KeyCh...
1,179
loop tbw msg = do drawTableWidget tablePos tableSize DHNormal tbw drawTextWidget msgPos msgSize DHNormal msg c <- CursesH.getKey done case c of Curses.KeyChar 'q' -> exitWith ExitSuccess Curses.KeyChar ' ' -> loop (tableWidgetScrollDown tableSize tbw) msg Curses.KeyCh...
1,179
loop tbw msg = do drawTableWidget tablePos tableSize DHNormal tbw drawTextWidget msgPos msgSize DHNormal msg c <- CursesH.getKey done case c of Curses.KeyChar 'q' -> exitWith ExitSuccess Curses.KeyChar ' ' -> loop (tableWidgetScrollDown tableSize tbw) msg Curses.KeyCh...
1,179
false
false
0
21
445
303
139
164
null
null
fmapfmapfmap/amazonka
amazonka-cloudwatch-logs/gen/Network/AWS/CloudWatchLogs/Types/Product.hs
mpl-2.0
-- | Undocumented member. mfFilterName :: Lens' MetricFilter (Maybe Text) mfFilterName = lens _mfFilterName (\ s a -> s{_mfFilterName = a})
139
mfFilterName :: Lens' MetricFilter (Maybe Text) mfFilterName = lens _mfFilterName (\ s a -> s{_mfFilterName = a})
113
mfFilterName = lens _mfFilterName (\ s a -> s{_mfFilterName = a})
65
true
true
0
9
20
46
25
21
null
null
olsner/ghc
compiler/typecheck/TcClassDcl.hs
bsd-3-clause
mkHsSigFun :: [LSig Name] -> HsSigFun mkHsSigFun sigs = lookupNameEnv env where env = mkHsSigEnv get_classop_sig sigs get_classop_sig :: LSig Name -> Maybe ([Located Name], LHsSigType Name) get_classop_sig (L _ (ClassOpSig _ ns hs_ty)) = Just (ns, hs_ty) get_classop_sig _ ...
360
mkHsSigFun :: [LSig Name] -> HsSigFun mkHsSigFun sigs = lookupNameEnv env where env = mkHsSigEnv get_classop_sig sigs get_classop_sig :: LSig Name -> Maybe ([Located Name], LHsSigType Name) get_classop_sig (L _ (ClassOpSig _ ns hs_ty)) = Just (ns, hs_ty) get_classop_sig _ ...
360
mkHsSigFun sigs = lookupNameEnv env where env = mkHsSigEnv get_classop_sig sigs get_classop_sig :: LSig Name -> Maybe ([Located Name], LHsSigType Name) get_classop_sig (L _ (ClassOpSig _ ns hs_ty)) = Just (ns, hs_ty) get_classop_sig _ = Nothing -------------------------...
322
false
true
0
9
92
114
57
57
null
null
tim-m89/hclr
Foreign/HCLR/Binding/Mono/Internal.hs
bsd-3-clause
monoInit :: IO MonoDomainPtr monoInit = do prog <- getProgName dom <- withCString (prog) mono_jit_init mono_config_parse nullPtr withCString "./" $ \baseDir-> withCString "hclr.config" $ \configFile-> do setupDomain dom baseDir configFile return dom
273
monoInit :: IO MonoDomainPtr monoInit = do prog <- getProgName dom <- withCString (prog) mono_jit_init mono_config_parse nullPtr withCString "./" $ \baseDir-> withCString "hclr.config" $ \configFile-> do setupDomain dom baseDir configFile return dom
273
monoInit = do prog <- getProgName dom <- withCString (prog) mono_jit_init mono_config_parse nullPtr withCString "./" $ \baseDir-> withCString "hclr.config" $ \configFile-> do setupDomain dom baseDir configFile return dom
244
false
true
0
14
55
91
39
52
null
null
pavelkogan/sff
Split.hs
mit
displayBooks :: [Book] -> String displayBooks = unlines . sort . elems . mapWithKey displayBook . makeMapBy bookName
118
displayBooks :: [Book] -> String displayBooks = unlines . sort . elems . mapWithKey displayBook . makeMapBy bookName
118
displayBooks = unlines . sort . elems . mapWithKey displayBook . makeMapBy bookName
85
false
true
0
8
19
40
20
20
null
null
sopvop/cabal
cabal-install/Distribution/Client/Sandbox.hs
bsd-3-clause
sandboxListSources :: Verbosity -> SandboxFlags -> GlobalFlags -> IO () sandboxListSources verbosity _sandboxFlags globalFlags = do (sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags indexFile <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv) refs <- Index.listBui...
973
sandboxListSources :: Verbosity -> SandboxFlags -> GlobalFlags -> IO () sandboxListSources verbosity _sandboxFlags globalFlags = do (sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags indexFile <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv) refs <- Index.listBui...
973
sandboxListSources verbosity _sandboxFlags globalFlags = do (sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags indexFile <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv) refs <- Index.listBuildTreeRefs verbosity Index.ListIgnored Index.LinksAndSnapshots indexFile when (nul...
879
false
true
0
14
222
189
88
101
null
null
co-dan/NPNTool
tests/Main.hs
bsd-3-clause
pn10 :: PTNet (_,pn10',l10) = flip runL new $ do [s1,s2,s3,s4] <- replicateM 4 mkPlace [tr1,tr2,tr3,tr4,tr5] <- replicateM 5 mkTrans [p1,p2,p3,p4,p5] <- replicateM 5 mkPlace [t1,t2,t3,t4] <- replicateM 4 mkTrans arc s1 tr1 arc tr1 s2 arc s2 tr2 arc tr2 s1 arc s2 tr3 arc tr3 p1 arc s2 tr4 ...
518
pn10 :: PTNet (_,pn10',l10) = flip runL new $ do [s1,s2,s3,s4] <- replicateM 4 mkPlace [tr1,tr2,tr3,tr4,tr5] <- replicateM 5 mkTrans [p1,p2,p3,p4,p5] <- replicateM 5 mkPlace [t1,t2,t3,t4] <- replicateM 4 mkTrans arc s1 tr1 arc tr1 s2 arc s2 tr2 arc tr2 s1 arc s2 tr3 arc tr3 p1 arc s2 tr4 ...
518
(_,pn10',l10) = flip runL new $ do [s1,s2,s3,s4] <- replicateM 4 mkPlace [tr1,tr2,tr3,tr4,tr5] <- replicateM 5 mkTrans [p1,p2,p3,p4,p5] <- replicateM 5 mkPlace [t1,t2,t3,t4] <- replicateM 4 mkTrans arc s1 tr1 arc tr1 s2 arc s2 tr2 arc tr2 s1 arc s2 tr3 arc tr3 p1 arc s2 tr4 arc tr4 s3 ...
504
false
true
0
9
161
308
138
170
null
null
dysinger/amazonka
amazonka-rds/gen/Network/AWS/RDS/Waiters.hs
mpl-2.0
dbInstanceAvailable :: Wait DescribeDBInstances dbInstanceAvailable = Wait { _waitName = "DBInstanceAvailable" , _waitAttempts = 60 , _waitDelay = 30 , _waitAcceptors = [ matchAll "available" AcceptSuccess (folding (concatOf ddbirDBInstances) . dbiDBInstanceStatus . _Just) ...
1,254
dbInstanceAvailable :: Wait DescribeDBInstances dbInstanceAvailable = Wait { _waitName = "DBInstanceAvailable" , _waitAttempts = 60 , _waitDelay = 30 , _waitAcceptors = [ matchAll "available" AcceptSuccess (folding (concatOf ddbirDBInstances) . dbiDBInstanceStatus . _Just) ...
1,254
dbInstanceAvailable = Wait { _waitName = "DBInstanceAvailable" , _waitAttempts = 60 , _waitDelay = 30 , _waitAcceptors = [ matchAll "available" AcceptSuccess (folding (concatOf ddbirDBInstances) . dbiDBInstanceStatus . _Just) , matchAny "deleted" AcceptFailure ...
1,206
false
true
0
15
309
284
145
139
null
null
binesiyu/ifl
examples/ch05/PrettyStub.hs
mit
{-- /snippet hcat --} {-- snippet fsep --} fsep :: [Doc] -> Doc fsep xs = undefined
84
fsep :: [Doc] -> Doc fsep xs = undefined
40
fsep xs = undefined
19
true
true
0
7
17
29
14
15
null
null
alanz/Blobs
lib/DData/IntSet.hs
lgpl-2.1
subsetCmp (Tip x) (Tip y) | x==y = EQ | otherwise = GT
67
subsetCmp (Tip x) (Tip y) | x==y = EQ | otherwise = GT
67
subsetCmp (Tip x) (Tip y) | x==y = EQ | otherwise = GT
67
false
false
1
8
25
41
19
22
null
null
lamdu/lamdu
test/Tests/Nix.hs
gpl-3.0
checkMissing :: Set String -> Set String -> String -> IO () checkMissing whole part msg | Set.null diff = pure () | otherwise = assertString (msg <> ": " <> show diff) where diff = Set.difference whole part
226
checkMissing :: Set String -> Set String -> String -> IO () checkMissing whole part msg | Set.null diff = pure () | otherwise = assertString (msg <> ": " <> show diff) where diff = Set.difference whole part
226
checkMissing whole part msg | Set.null diff = pure () | otherwise = assertString (msg <> ": " <> show diff) where diff = Set.difference whole part
166
false
true
1
9
58
96
44
52
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x1F33' = "\x03B9\x0314\x0300"
45
decomposeChar '\x1F33' = "\x03B9\x0314\x0300"
45
decomposeChar '\x1F33' = "\x03B9\x0314\x0300"
45
false
false
0
4
3
10
4
6
null
null
jsavatgy/hatupist
code/fileError.hs
gpl-2.0
labelStrings :: Int -> [String] -> [String] labelStrings startline textLines = [textLines !! first] ++ [textLines !! second] where first = startline `mod` (length textLines) second = (startline + 1) `mod` (length textLines)
235
labelStrings :: Int -> [String] -> [String] labelStrings startline textLines = [textLines !! first] ++ [textLines !! second] where first = startline `mod` (length textLines) second = (startline + 1) `mod` (length textLines)
235
labelStrings startline textLines = [textLines !! first] ++ [textLines !! second] where first = startline `mod` (length textLines) second = (startline + 1) `mod` (length textLines)
191
false
true
2
8
44
103
52
51
null
null
coolhacks/scripts-hacks
examples/shellcheck-master/ShellCheck/Parser.hs
mit
readGenericLiteral endChars = do strings <- many (readGenericEscaped <|> many1 (noneOf ('\\':endChars))) return $ concat strings
136
readGenericLiteral endChars = do strings <- many (readGenericEscaped <|> many1 (noneOf ('\\':endChars))) return $ concat strings
136
readGenericLiteral endChars = do strings <- many (readGenericEscaped <|> many1 (noneOf ('\\':endChars))) return $ concat strings
136
false
false
0
15
23
52
24
28
null
null
ganeti/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
jobStatusWaiting :: String jobStatusWaiting = Types.jobStatusToRaw JOB_STATUS_WAITING
85
jobStatusWaiting :: String jobStatusWaiting = Types.jobStatusToRaw JOB_STATUS_WAITING
85
jobStatusWaiting = Types.jobStatusToRaw JOB_STATUS_WAITING
58
false
true
0
6
6
16
8
8
null
null
sdzivanovich/cs1699_deliverable5
Main.hs
bsd-3-clause
-- an element within the length of the replicated list is the replicated element. prop_elementOfReplicatedList :: Int -> Int -> Int -> Property prop_elementOfReplicatedList n i x = n >= 0 && i >= 0 && i < n ==> (My.replicate n x !! i) == x
239
prop_elementOfReplicatedList :: Int -> Int -> Int -> Property prop_elementOfReplicatedList n i x = n >= 0 && i >= 0 && i < n ==> (My.replicate n x !! i) == x
157
prop_elementOfReplicatedList n i x = n >= 0 && i >= 0 && i < n ==> (My.replicate n x !! i) == x
95
true
true
2
10
46
81
39
42
null
null
brendanhay/gogol
gogol-games/gen/Network/Google/Resource/Games/Stats/Get.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). sgUploadProtocol :: Lens' StatsGet (Maybe Text) sgUploadProtocol = lens _sgUploadProtocol (\ s a -> s{_sgUploadProtocol = a})
195
sgUploadProtocol :: Lens' StatsGet (Maybe Text) sgUploadProtocol = lens _sgUploadProtocol (\ s a -> s{_sgUploadProtocol = a})
133
sgUploadProtocol = lens _sgUploadProtocol (\ s a -> s{_sgUploadProtocol = a})
85
true
true
0
8
33
49
25
24
null
null
matkli/hscheme
Types.hs
gpl-3.0
-- | Test expressions testExpr :: [Expr] testExpr = [List [Number 1, Number 2], Dotted [String "asdf", Bool True] (Bool False), Symbol "atom", List []]
171
testExpr :: [Expr] testExpr = [List [Number 1, Number 2], Dotted [String "asdf", Bool True] (Bool False), Symbol "atom", List []]
149
testExpr = [List [Number 1, Number 2], Dotted [String "asdf", Bool True] (Bool False), Symbol "atom", List []]
130
true
true
0
8
44
73
38
35
null
null
robinp/haskell-toys
src/Toys/MonadPar/Main.hs
bsd-3-clause
t = 28
6
t = 28
6
t = 28
6
false
false
1
5
2
10
3
7
null
null
ejlilley/AbstractMusic
LilyConvert.hs
gpl-3.0
filterOut (Lyrics (LilyLyrics a e)) = Lyrics $ LilyLyrics a (filterOut e)
73
filterOut (Lyrics (LilyLyrics a e)) = Lyrics $ LilyLyrics a (filterOut e)
73
filterOut (Lyrics (LilyLyrics a e)) = Lyrics $ LilyLyrics a (filterOut e)
73
false
false
0
9
11
38
18
20
null
null
darthdeus/ghc-mod-ng
src/GHCModi.hs
bsd-3-clause
argspec :: [OptDescr (Options -> Options)] argspec = [ Option "b" ["boundary"] (ReqArg (\s opts -> opts { lineSeparator = LineSeparator s }) "sep") "specify line separator (default is Nul string)" , Option "l" ["tolisp"] (NoArg (\opts -> opts { outputStyle = LispStyle })) ...
492
argspec :: [OptDescr (Options -> Options)] argspec = [ Option "b" ["boundary"] (ReqArg (\s opts -> opts { lineSeparator = LineSeparator s }) "sep") "specify line separator (default is Nul string)" , Option "l" ["tolisp"] (NoArg (\opts -> opts { outputStyle = LispStyle })) ...
492
argspec = [ Option "b" ["boundary"] (ReqArg (\s opts -> opts { lineSeparator = LineSeparator s }) "sep") "specify line separator (default is Nul string)" , Option "l" ["tolisp"] (NoArg (\opts -> opts { outputStyle = LispStyle })) "print as a list of Lisp" ...
449
false
true
0
15
162
159
84
75
null
null
ezyang/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
mempty_RDR = varQual_RDR gHC_BASE (fsLit "mempty")
74
mempty_RDR = varQual_RDR gHC_BASE (fsLit "mempty")
74
mempty_RDR = varQual_RDR gHC_BASE (fsLit "mempty")
74
false
false
1
7
29
20
8
12
null
null
nhenezi/csvtt
csvtt.hs
mit
main = do (inFile:output) <- getArgs let outFile = head output file <- readFile inFile let list = csvToList ',' file writeFile outFile $ makeTable " " (sameSizeTable (tail list))
188
main = do (inFile:output) <- getArgs let outFile = head output file <- readFile inFile let list = csvToList ',' file writeFile outFile $ makeTable " " (sameSizeTable (tail list))
188
main = do (inFile:output) <- getArgs let outFile = head output file <- readFile inFile let list = csvToList ',' file writeFile outFile $ makeTable " " (sameSizeTable (tail list))
188
false
false
1
13
39
87
37
50
null
null
loadimpact/http2-test
hs-src/Rede/MainLoop/CoherentWorker.hs
bsd-3-clause
waitRequestBody :: InputDataStream -> IO B.ByteString waitRequestBody source = let consumer b = do maybe_bytes <- await case maybe_bytes of Just bytes -> do -- liftIO $ putStrLn $ "Got bytes " ++ (show $ B.length bytes) consumer $ b `M.mappend` (Bu...
571
waitRequestBody :: InputDataStream -> IO B.ByteString waitRequestBody source = let consumer b = do maybe_bytes <- await case maybe_bytes of Just bytes -> do -- liftIO $ putStrLn $ "Got bytes " ++ (show $ B.length bytes) consumer $ b `M.mappend` (Bu...
571
waitRequestBody source = let consumer b = do maybe_bytes <- await case maybe_bytes of Just bytes -> do -- liftIO $ putStrLn $ "Got bytes " ++ (show $ B.length bytes) consumer $ b `M.mappend` (Bu.byteString bytes) Nothing -> do ...
517
false
true
0
19
197
143
68
75
null
null
keera-studios/hsQt
Qtc/ClassTypes/Gui.hs
bsd-2-clause
qCalendarWidgetListFromPtrList :: [Ptr (TQCalendarWidget a)] -> IO [QCalendarWidget a] qCalendarWidgetListFromPtrList p = objectListFromPtrList qtc_QCalendarWidget_getFinalizer p
180
qCalendarWidgetListFromPtrList :: [Ptr (TQCalendarWidget a)] -> IO [QCalendarWidget a] qCalendarWidgetListFromPtrList p = objectListFromPtrList qtc_QCalendarWidget_getFinalizer p
180
qCalendarWidgetListFromPtrList p = objectListFromPtrList qtc_QCalendarWidget_getFinalizer p
93
false
true
0
9
16
44
21
23
null
null
brendanhay/gogol
gogol-datafusion/gen/Network/Google/DataFusion/Types/Product.hs
mpl-2.0
-- | The time the operation was created. omCreateTime :: Lens' OperationMetadata (Maybe UTCTime) omCreateTime = lens _omCreateTime (\ s a -> s{_omCreateTime = a}) . mapping _DateTime
190
omCreateTime :: Lens' OperationMetadata (Maybe UTCTime) omCreateTime = lens _omCreateTime (\ s a -> s{_omCreateTime = a}) . mapping _DateTime
149
omCreateTime = lens _omCreateTime (\ s a -> s{_omCreateTime = a}) . mapping _DateTime
93
true
true
0
10
35
55
28
27
null
null
bell-kelly/courseography
app/Response/Draw.hs
gpl-3.0
modePanel :: H.Html modePanel = H.div ! A.id "side-panel-wrap" $ do H.div ! A.id "node-mode" ! A.class_ "mode clicked" $ "NODE (n)" H.input ! A.id "course-code" ! A.class_ "course-code" ! A.name "course-code" ! A.placeholder "Course Code" ! A.autocomplete "off" ...
1,515
modePanel :: H.Html modePanel = H.div ! A.id "side-panel-wrap" $ do H.div ! A.id "node-mode" ! A.class_ "mode clicked" $ "NODE (n)" H.input ! A.id "course-code" ! A.class_ "course-code" ! A.name "course-code" ! A.placeholder "Course Code" ! A.autocomplete "off" ...
1,515
modePanel = H.div ! A.id "side-panel-wrap" $ do H.div ! A.id "node-mode" ! A.class_ "mode clicked" $ "NODE (n)" H.input ! A.id "course-code" ! A.class_ "course-code" ! A.name "course-code" ! A.placeholder "Course Code" ! A.autocomplete "off" ! A.type_ ...
1,495
false
true
0
16
471
548
249
299
null
null
owickstrom/dotfiles
src/Dotfiles/Packages.hs
mit
toInstallFor :: OS -> IO [PackageID] toInstallFor os' = filterM (isNotInstalled os') (packages os')
99
toInstallFor :: OS -> IO [PackageID] toInstallFor os' = filterM (isNotInstalled os') (packages os')
99
toInstallFor os' = filterM (isNotInstalled os') (packages os')
62
false
true
0
7
13
41
20
21
null
null
nyaxt/dmix
nkmd/as/Preprocessor.hs
mit
preprocessStmt (StConstExpr name expr) = insertConstExpr name expr
66
preprocessStmt (StConstExpr name expr) = insertConstExpr name expr
66
preprocessStmt (StConstExpr name expr) = insertConstExpr name expr
66
false
false
0
7
7
22
10
12
null
null
phylake/avm3
llvm/passes/abct.hs
mit
abcT1 {- 0x34 -} i u d s m (br, Abc.PushDNaN) = (br, [PushDNaN])
64
abcT1 {- 0x34 -} i u d s m (br, Abc.PushDNaN) = (br, [PushDNaN])
64
abcT1 {- 0x34 -} i u d s m (br, Abc.PushDNaN) = (br, [PushDNaN])
64
false
false
0
7
13
38
21
17
null
null
mstksg/tensor-ops
src/TensorOps/TOp.hs
bsd-3-clause
sumRows :: forall n ns. (SingI n, SingI ns) => TOp '[ n ': ns ] '[ ns ] sumRows = TOp (only . T.sumRows . TCP.head') (\case x :< Ø -> \case dtdz :< Ø -> only $ mapRows (LS LZ) (\_ -> dtdz) x )
266
sumRows :: forall n ns. (SingI n, SingI ns) => TOp '[ n ': ns ] '[ ns ] sumRows = TOp (only . T.sumRows . TCP.head') (\case x :< Ø -> \case dtdz :< Ø -> only $ mapRows (LS LZ) (\_ -> dtdz) x )
266
sumRows = TOp (only . T.sumRows . TCP.head') (\case x :< Ø -> \case dtdz :< Ø -> only $ mapRows (LS LZ) (\_ -> dtdz) x )
186
false
true
0
16
120
125
66
59
null
null
bergmark/clay
src/Clay/Media.hs
bsd-3-clause
monochrome = without "monochrome"
33
monochrome = without "monochrome"
33
monochrome = without "monochrome"
33
false
false
0
5
3
9
4
5
null
null
anttisalonen/freekick
haskell/libfreekick/Freekick/Libsoccer/Database.hs
agpl-3.0
parsePlayerXML :: FilePath -> IO [Player] parsePlayerXML file = parseXMLResource file "Players" parsePlayer
107
parsePlayerXML :: FilePath -> IO [Player] parsePlayerXML file = parseXMLResource file "Players" parsePlayer
107
parsePlayerXML file = parseXMLResource file "Players" parsePlayer
65
false
true
0
8
12
37
16
21
null
null
unknownloner/calccomp
Asm/InstrBytes.hs
mit
instrBytes LD (Reg8 l:Num r:_) = w8l [regBits 6 l 3, r]
71
instrBytes LD (Reg8 l:Num r:_) = w8l [regBits 6 l 3, r]
71
instrBytes LD (Reg8 l:Num r:_) = w8l [regBits 6 l 3, r]
71
false
false
0
9
27
44
21
23
null
null
shayan-najd/HsParser
U/Panic.hs
gpl-3.0
progName :: String progName = unsafePerformIO (getProgName)
59
progName :: String progName = unsafePerformIO (getProgName)
59
progName = unsafePerformIO (getProgName)
40
false
true
0
6
6
23
10
13
null
null
olsner/ghc
testsuite/tests/perf/compiler/T10370.hs
bsd-3-clause
a350 :: IO (); a350 = forever $ putStrLn "a350"
47
a350 :: IO () a350 = forever $ putStrLn "a350"
46
a350 = forever $ putStrLn "a350"
32
false
true
0
6
9
24
12
12
null
null
fhaust/aer-utils
src/OlshausenOnStreams.hs
mit
reconstructEvents :: (Ord a, Num a) => [Event a] -> [Events a] -> Events a reconstructEvents as φs = mergeEvents $ zipWith (\a φ -> V.map (\e -> a * e) φ) as φs
160
reconstructEvents :: (Ord a, Num a) => [Event a] -> [Events a] -> Events a reconstructEvents as φs = mergeEvents $ zipWith (\a φ -> V.map (\e -> a * e) φ) as φs
160
reconstructEvents as φs = mergeEvents $ zipWith (\a φ -> V.map (\e -> a * e) φ) as φs
85
false
true
0
12
33
94
48
46
null
null
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/EnableVGWRoutePropagation.hs
mpl-2.0
-- | The ID of the virtual private gateway. evrpGatewayId :: Lens' EnableVGWRoutePropagation Text evrpGatewayId = lens _evrpGatewayId (\ s a -> s{_evrpGatewayId = a})
166
evrpGatewayId :: Lens' EnableVGWRoutePropagation Text evrpGatewayId = lens _evrpGatewayId (\ s a -> s{_evrpGatewayId = a})
122
evrpGatewayId = lens _evrpGatewayId (\ s a -> s{_evrpGatewayId = a})
68
true
true
0
9
24
40
22
18
null
null
mrakgr/futhark
src/Futhark/TypeCheck.hs
bsd-3-clause
checkExp (DoLoop ctxmerge valmerge form loopbody) = do let merge = ctxmerge ++ valmerge (mergepat, mergeexps) = unzip merge mergeargs <- mapM checkArg mergeexps funparams <- case form of ForLoop loopvar boundexp -> do iparam <- primFParam loopvar int32 let funparams = iparam : mergepat ...
1,869
checkExp (DoLoop ctxmerge valmerge form loopbody) = do let merge = ctxmerge ++ valmerge (mergepat, mergeexps) = unzip merge mergeargs <- mapM checkArg mergeexps funparams <- case form of ForLoop loopvar boundexp -> do iparam <- primFParam loopvar int32 let funparams = iparam : mergepat ...
1,869
checkExp (DoLoop ctxmerge valmerge form loopbody) = do let merge = ctxmerge ++ valmerge (mergepat, mergeexps) = unzip merge mergeargs <- mapM checkArg mergeexps funparams <- case form of ForLoop loopvar boundexp -> do iparam <- primFParam loopvar int32 let funparams = iparam : mergepat ...
1,869
false
false
0
26
593
515
242
273
null
null
tjakway/ghcjvm
compiler/codeGen/StgCmmClosure.hs
bsd-3-clause
-- might be a function getCallMethod _ name _ (LFUnknown False) n_args _v_args _cg_loc _self_loop_info = ASSERT2( n_args == 0, ppr name <+> ppr n_args ) EnterIt
167
getCallMethod _ name _ (LFUnknown False) n_args _v_args _cg_loc _self_loop_info = ASSERT2( n_args == 0, ppr name <+> ppr n_args ) EnterIt
143
getCallMethod _ name _ (LFUnknown False) n_args _v_args _cg_loc _self_loop_info = ASSERT2( n_args == 0, ppr name <+> ppr n_args ) EnterIt
143
true
false
3
7
33
64
27
37
null
null
pyr/himpy
System/Himpy/Mib.hs
mit
ioStatDisks = [1,3,6,1,4,1,25359,4,1,1] :: RawOID
49
ioStatDisks = [1,3,6,1,4,1,25359,4,1,1] :: RawOID
49
ioStatDisks = [1,3,6,1,4,1,25359,4,1,1] :: RawOID
49
false
false
0
5
4
39
25
14
null
null
np/propellor
src/Utility/Monad.hs
bsd-2-clause
{- Returns true if any value in the list satisfies the predicate, - stopping once one is found. -} anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool anyM p = liftM isJust . firstM p
182
anyM :: Monad m => (a -> m Bool) -> [a] -> m Bool anyM p = liftM isJust . firstM p
82
anyM p = liftM isJust . firstM p
32
true
true
0
9
41
56
27
29
null
null
Bodigrim/arithmoi
test-suite/Math/NumberTheory/Moduli/SqrtTests.hs
mit
sqrtsModFactorisationSpecialCase2 :: Assertion sqrtsModFactorisationSpecialCase2 = assertEqual "should be equal" [0] (sqrtsModFactorisation 0 $ map (first (fromJust . isPrime)) [(3 :: Integer, 1), (5, 1)])
211
sqrtsModFactorisationSpecialCase2 :: Assertion sqrtsModFactorisationSpecialCase2 = assertEqual "should be equal" [0] (sqrtsModFactorisation 0 $ map (first (fromJust . isPrime)) [(3 :: Integer, 1), (5, 1)])
211
sqrtsModFactorisationSpecialCase2 = assertEqual "should be equal" [0] (sqrtsModFactorisation 0 $ map (first (fromJust . isPrime)) [(3 :: Integer, 1), (5, 1)])
164
false
true
0
11
29
72
39
33
null
null
cies/gelatin
gelatin-gl/src/Gelatin/GL/Renderer.hs
bsd-3-clause
setProjectionUniforms :: [Shader] -> Context -> Transform -> IO () setProjectionUniforms srcs window t = do pj <- orthoContextProjection window mapM_ (updateUniform $ UniformProjection pj) srcs let mv = modelviewProjection t mapM_ (updateUniform $ UniformModelView mv) srcs -----------------------------...
478
setProjectionUniforms :: [Shader] -> Context -> Transform -> IO () setProjectionUniforms srcs window t = do pj <- orthoContextProjection window mapM_ (updateUniform $ UniformProjection pj) srcs let mv = modelviewProjection t mapM_ (updateUniform $ UniformModelView mv) srcs -----------------------------...
478
setProjectionUniforms srcs window t = do pj <- orthoContextProjection window mapM_ (updateUniform $ UniformProjection pj) srcs let mv = modelviewProjection t mapM_ (updateUniform $ UniformModelView mv) srcs -------------------------------------------------------------------------------- -- Working with...
411
false
true
0
10
59
99
47
52
null
null
gbataille/pandoc
src/Text/Pandoc/Readers/Docx/Lists.hs
gpl-2.0
getListType :: Block -> Maybe ListType getListType b@(Div (_, _, kvs) _) | isListItem b = let start = lookup "start" kvs frmt = lookup "format" kvs txt = lookup "text" kvs in case frmt of Just "bullet" -> Just Itemized Just f -> case txt of Just t -> Just $ Enumerate...
554
getListType :: Block -> Maybe ListType getListType b@(Div (_, _, kvs) _) | isListItem b = let start = lookup "start" kvs frmt = lookup "format" kvs txt = lookup "text" kvs in case frmt of Just "bullet" -> Just Itemized Just f -> case txt of Just t -> Just $ Enumerate...
554
getListType b@(Div (_, _, kvs) _) | isListItem b = let start = lookup "start" kvs frmt = lookup "format" kvs txt = lookup "text" kvs in case frmt of Just "bullet" -> Just Itemized Just f -> case txt of Just t -> Just $ Enumerated ( read (fromMaybe "...
515
false
true
0
19
196
192
93
99
null
null
brendanhay/gogol
gogol-iap/gen/Network/Google/Resource/IAP/Projects/Brands/IdentityAwareProxyClients/ResetSecret.hs
mpl-2.0
-- | JSONP pbiapcrsCallback :: Lens' ProjectsBrandsIdentityAwareProxyClientsResetSecret (Maybe Text) pbiapcrsCallback = lens _pbiapcrsCallback (\ s a -> s{_pbiapcrsCallback = a})
186
pbiapcrsCallback :: Lens' ProjectsBrandsIdentityAwareProxyClientsResetSecret (Maybe Text) pbiapcrsCallback = lens _pbiapcrsCallback (\ s a -> s{_pbiapcrsCallback = a})
175
pbiapcrsCallback = lens _pbiapcrsCallback (\ s a -> s{_pbiapcrsCallback = a})
85
true
true
1
9
27
51
25
26
null
null
olsner/ghc
compiler/simplCore/SetLevels.hs
bsd-3-clause
lvlCase :: LevelEnv -- Level of in-scope names/tyvars -> DVarSet -- Free vars of input scrutinee -> LevelledExpr -- Processed scrutinee -> Id -> Type -- Case binder and result type -> [CoreAltWithFVs] -- Input alternatives -> LvlM Le...
3,394
lvlCase :: LevelEnv -- Level of in-scope names/tyvars -> DVarSet -- Free vars of input scrutinee -> LevelledExpr -- Processed scrutinee -> Id -> Type -- Case binder and result type -> [CoreAltWithFVs] -- Input alternatives -> LvlM Le...
3,370
lvlCase env scrut_fvs scrut' case_bndr ty alts | [(con@(DataAlt {}), bs, body)] <- alts , exprOkForSpeculation scrut' -- See Note [Check the output scrutinee for okForSpec] , not (isTopLvl dest_lvl) -- Can't have top-level cases , not (floatTopLvlOnly env) -- Can float anywhere = -- See Note [...
3,039
true
true
2
15
915
496
255
241
null
null
Elastifile/git-sling
server/src/Sling/Git.hs
gpl-2.0
-- shortenRef :: Ref -> EShell Ref -- shortenRef = refTraverseHash shortenHash refToHash :: Ref -> EShell Hash refToHash ref = hash . head <$> git ["rev-parse", refName ref]
174
refToHash :: Ref -> EShell Hash refToHash ref = hash . head <$> git ["rev-parse", refName ref]
94
refToHash ref = hash . head <$> git ["rev-parse", refName ref]
62
true
true
0
8
29
43
22
21
null
null
micknelso/language-c
test-framework/Language/C/Test/ParseTests.hs
bsd-3-clause
-- =================== -- = Misc = -- =================== lineCount :: FilePath -> IO Int lineCount = liftM (length . lines) . readFile
147
lineCount :: FilePath -> IO Int lineCount = liftM (length . lines) . readFile
77
lineCount = liftM (length . lines) . readFile
45
true
true
0
8
33
35
19
16
null
null
icyfork/shellcheck
ShellCheck/Parser.hs
gpl-3.0
readDoubleQuoted = called "double quoted string" $ do id <- getNextId startPos <- getPosition doubleQuote x <- many doubleQuotedPart endPos <- getPosition doubleQuote <?> "end of double quoted string" optional $ do try . lookAhead $ suspectCharAfterQuotes <|> oneOf "$\"" when...
663
readDoubleQuoted = called "double quoted string" $ do id <- getNextId startPos <- getPosition doubleQuote x <- many doubleQuotedPart endPos <- getPosition doubleQuote <?> "end of double quoted string" optional $ do try . lookAhead $ suspectCharAfterQuotes <|> oneOf "$\"" when...
663
readDoubleQuoted = called "double quoted string" $ do id <- getNextId startPos <- getPosition doubleQuote x <- many doubleQuotedPart endPos <- getPosition doubleQuote <?> "end of double quoted string" optional $ do try . lookAhead $ suspectCharAfterQuotes <|> oneOf "$\"" when...
663
false
false
1
17
162
211
93
118
null
null
florianpilz/autotool
src/Binpack/Interface.hs
gpl-2.0
used_bins :: Assignment -> Int used_bins b = length b
53
used_bins :: Assignment -> Int used_bins b = length b
53
used_bins b = length b
22
false
true
0
7
9
26
11
15
null
null
AlexanderPankiv/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
ctOrigin :: Ct -> CtOrigin ctOrigin = ctLocOrigin . ctLoc
57
ctOrigin :: Ct -> CtOrigin ctOrigin = ctLocOrigin . ctLoc
57
ctOrigin = ctLocOrigin . ctLoc
30
false
true
0
5
9
19
10
9
null
null
haskellbr/missingh
missingh-all/src/System/IO/StatCompat.hs
mit
isRegularFile = sc_helper regularFileMode
41
isRegularFile = sc_helper regularFileMode
41
isRegularFile = sc_helper regularFileMode
41
false
false
0
5
3
9
4
5
null
null
zmactep/zero-aligner
src/Sequence/Alignment/Instances.hs
bsd-3-clause
semiglobalStart :: Matrix -> (Int, Int) semiglobalStart mat = listKeyByValMax $ lastRow ++ lastCol where lastRow = ap (,) (mat !) . (me,) <$> [ns..ne] lastCol = ap (,) (mat !) . (,ne) <$> [ms..me] ((ms, ns), (me, ne)) = bounds mat
248
semiglobalStart :: Matrix -> (Int, Int) semiglobalStart mat = listKeyByValMax $ lastRow ++ lastCol where lastRow = ap (,) (mat !) . (me,) <$> [ns..ne] lastCol = ap (,) (mat !) . (,ne) <$> [ms..me] ((ms, ns), (me, ne)) = bounds mat
248
semiglobalStart mat = listKeyByValMax $ lastRow ++ lastCol where lastRow = ap (,) (mat !) . (me,) <$> [ns..ne] lastCol = ap (,) (mat !) . (,ne) <$> [ms..me] ((ms, ns), (me, ne)) = bounds mat
208
false
true
0
8
59
130
74
56
null
null
KaneTW/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
runIdeModeCommand h id orig fn mods (IdeMode.Metavariables cols) = do ist <- getIState let mvs = reverse $ map fst (idris_metavars ist) \\ primDefs let ppo = ppOptionIst ist -- splitMvs is a list of pairs of names and their split types let splitMvs = mapSnd (splitPi ist) (mvTys ist mvs) -- mv...
2,945
runIdeModeCommand h id orig fn mods (IdeMode.Metavariables cols) = do ist <- getIState let mvs = reverse $ map fst (idris_metavars ist) \\ primDefs let ppo = ppOptionIst ist -- splitMvs is a list of pairs of names and their split types let splitMvs = mapSnd (splitPi ist) (mvTys ist mvs) -- mv...
2,945
runIdeModeCommand h id orig fn mods (IdeMode.Metavariables cols) = do ist <- getIState let mvs = reverse $ map fst (idris_metavars ist) \\ primDefs let ppo = ppOptionIst ist -- splitMvs is a list of pairs of names and their split types let splitMvs = mapSnd (splitPi ist) (mvTys ist mvs) -- mv...
2,945
false
false
4
25
1,207
892
467
425
null
null
ekmett/hmpfr
src/Data/Number/MPFR/Special.hs
bsd-3-clause
j0_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int) j0_ r p d = withMPFR r p d mpfr_j0
93
j0_ :: RoundMode -> Precision -> MPFR -> (MPFR, Int) j0_ r p d = withMPFR r p d mpfr_j0
93
j0_ r p d = withMPFR r p d mpfr_j0
34
false
true
0
8
25
46
23
23
null
null
FranklinChen/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
safeForgetEnv env (Bind n b sc) = do let n' = uniqueName n env b' <- safeForgetEnvB env b sc' <- safeForgetEnv (n':env) sc Just $ RBind n' b' sc' where safeForgetEnvB env (Let t v) = liftM2 Let (safeForgetEnv env t) (safeForgetEnv en...
608
safeForgetEnv env (Bind n b sc) = do let n' = uniqueName n env b' <- safeForgetEnvB env b sc' <- safeForgetEnv (n':env) sc Just $ RBind n' b' sc' where safeForgetEnvB env (Let t v) = liftM2 Let (safeForgetEnv env t) (safeForgetEnv en...
608
safeForgetEnv env (Bind n b sc) = do let n' = uniqueName n env b' <- safeForgetEnvB env b sc' <- safeForgetEnv (n':env) sc Just $ RBind n' b' sc' where safeForgetEnvB env (Let t v) = liftM2 Let (safeForgetEnv env t) (safeForgetEnv en...
608
false
false
0
10
267
214
100
114
null
null
apyrgio/snf-ganeti
src/Ganeti/HTools/Program/Hscan.hs
bsd-2-clause
-- | Replace slashes with underscore for saving to filesystem. fixSlash :: String -> String fixSlash = map (\x -> if x == '/' then '_' else x)
142
fixSlash :: String -> String fixSlash = map (\x -> if x == '/' then '_' else x)
79
fixSlash = map (\x -> if x == '/' then '_' else x)
50
true
true
0
9
27
46
23
23
null
null
jonte/ircbot
Network/IRC/Bot/Commands.hs
bsd-3-clause
sendCommand :: (ToMessage c, BotMonad m, Functor m) => c -> m () sendCommand c = sendMessage (toMessage c)
106
sendCommand :: (ToMessage c, BotMonad m, Functor m) => c -> m () sendCommand c = sendMessage (toMessage c)
106
sendCommand c = sendMessage (toMessage c)
41
false
true
0
8
18
53
26
27
null
null
psibi/cabal2nix
src/hackage2nix.hs
bsd-3-clause
enforcePreferredVersions :: [Constraint] -> String -> Map Version GenericPackageDescription -> Map Version GenericPackageDescription enforcePreferredVersions cs pkg = Map.filterWithKey (\v _ -> PackageIdentifier (PackageName pkg) v `satisfiesConstraints` cs)
283
enforcePreferredVersions :: [Constraint] -> String -> Map Version GenericPackageDescription -> Map Version GenericPackageDescription enforcePreferredVersions cs pkg = Map.filterWithKey (\v _ -> PackageIdentifier (PackageName pkg) v `satisfiesConstraints` cs)
283
enforcePreferredVersions cs pkg = Map.filterWithKey (\v _ -> PackageIdentifier (PackageName pkg) v `satisfiesConstraints` cs)
125
false
true
0
11
51
73
37
36
null
null
PaulGustafson/stringnet
LocalMoves.hs
mit
nitialPerimeter LeftDisk = [Reverse $ IE LeftLoop, IE LeftLeg, Reverse $ IE LeftLeg]
89
initialPerimeter LeftDisk = [Reverse $ IE LeftLoop, IE LeftLeg, Reverse $ IE LeftLeg]
89
initialPerimeter LeftDisk = [Reverse $ IE LeftLoop, IE LeftLeg, Reverse $ IE LeftLeg]
89
false
false
0
7
17
35
17
18
null
null
AnttiLukats/orp
software/tools/tidl/src/Tidl/Generate/Java.hs
apache-2.0
generateFieldSerial' name (FInt IKSigned IS64) = text "TIDL.int64_serialize(out," <+> text name <> text ");"
108
generateFieldSerial' name (FInt IKSigned IS64) = text "TIDL.int64_serialize(out," <+> text name <> text ");"
108
generateFieldSerial' name (FInt IKSigned IS64) = text "TIDL.int64_serialize(out," <+> text name <> text ");"
108
false
false
0
7
13
36
16
20
null
null
nushio3/ghc
compiler/stgSyn/StgLint.hs
bsd-3-clause
mkAlgAltMsg2 :: Type -> DataCon -> MsgDoc mkAlgAltMsg2 ty con = vcat [ text "In some algebraic case alternative, constructor is not a constructor of scrutinee type:", ppr ty, ppr con ]
214
mkAlgAltMsg2 :: Type -> DataCon -> MsgDoc mkAlgAltMsg2 ty con = vcat [ text "In some algebraic case alternative, constructor is not a constructor of scrutinee type:", ppr ty, ppr con ]
214
mkAlgAltMsg2 ty con = vcat [ text "In some algebraic case alternative, constructor is not a constructor of scrutinee type:", ppr ty, ppr con ]
172
false
true
0
8
61
51
23
28
null
null
hackern/network-transport-ivc
src/Network/Transport/IVC/Util.hs
mit
waitForKeys :: XenStore -> FilePath -> Int -> IO [String] waitForKeys xs path num = do keys <- listKeys xs path if length keys < num then do threadDelay 100000 waitForKeys xs path num else return keys
220
waitForKeys :: XenStore -> FilePath -> Int -> IO [String] waitForKeys xs path num = do keys <- listKeys xs path if length keys < num then do threadDelay 100000 waitForKeys xs path num else return keys
220
waitForKeys xs path num = do keys <- listKeys xs path if length keys < num then do threadDelay 100000 waitForKeys xs path num else return keys
162
false
true
0
11
56
90
40
50
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
isSpellCaster ProtossArbiterTribunal = False
44
isSpellCaster ProtossArbiterTribunal = False
44
isSpellCaster ProtossArbiterTribunal = False
44
false
false
0
5
3
9
4
5
null
null
ruicc/chat-server
tests/Tasty.hs
mit
tests :: TestTree tests = testGroup "Tests" [ qcProps ]
55
tests :: TestTree tests = testGroup "Tests" [ qcProps ]
55
tests = testGroup "Tests" [ qcProps ]
37
false
true
0
6
9
19
10
9
null
null
graninas/Haskell-Algorithms
Tests/Robotics/Task2.hs
gpl-3.0
moveKiki (kx, ky) 'd' = (normalize $ kx + 1, ky)
48
moveKiki (kx, ky) 'd' = (normalize $ kx + 1, ky)
48
moveKiki (kx, ky) 'd' = (normalize $ kx + 1, ky)
48
false
false
0
7
10
31
17
14
null
null
JohnLato/jaek
src/Jaek/UI/FrpHandlers.hs
lgpl-3.0
keypressEvents :: WidgetClass w => w -> NetworkDescription (Event KeyVal) keypressEvents widget = event1 $ \k -> ignore $ on widget keyPressEvent $ tryEvent $ do kv <- eventKeyVal when DEBUG $ liftIO $ print $ "got KeyVal: " ++ show kv liftIO $ k kv
263
keypressEvents :: WidgetClass w => w -> NetworkDescription (Event KeyVal) keypressEvents widget = event1 $ \k -> ignore $ on widget keyPressEvent $ tryEvent $ do kv <- eventKeyVal when DEBUG $ liftIO $ print $ "got KeyVal: " ++ show kv liftIO $ k kv
263
keypressEvents widget = event1 $ \k -> ignore $ on widget keyPressEvent $ tryEvent $ do kv <- eventKeyVal when DEBUG $ liftIO $ print $ "got KeyVal: " ++ show kv liftIO $ k kv
189
false
true
6
13
59
111
48
63
null
null
dkensinger/haskell
haskell-primes/NaurPrimes.hs
gpl-3.0
primesToLimit :: Integer -> [Integer] primesToLimit limit = takeWhile (< limit) (calcPrimes ())
95
primesToLimit :: Integer -> [Integer] primesToLimit limit = takeWhile (< limit) (calcPrimes ())
95
primesToLimit limit = takeWhile (< limit) (calcPrimes ())
57
false
true
0
8
12
38
20
18
null
null
robdockins/edison
test/src/Data/Edison/Test/Set.hs
mit
prop_strict :: SetTest a set => set a -> set a -> Bool prop_strict set xs = strict xs === xs && strictWith (+1) xs === xs
130
prop_strict :: SetTest a set => set a -> set a -> Bool prop_strict set xs = strict xs === xs && strictWith (+1) xs === xs
130
prop_strict set xs = strict xs === xs && strictWith (+1) xs === xs
75
false
true
4
8
35
69
33
36
null
null
diku-dk/futhark
src/Futhark/CodeGen/Backends/GenericPython/Options.hs
isc
-- | Generate option parsing code that accepts the given command line options. Will read from @sys.argv@. -- -- If option parsing fails for any reason, the entire process will -- terminate with error code 1. generateOptionParser :: [Option] -> [PyStmt] generateOptionParser options = [ Assign (Var "parser") ...
1,924
generateOptionParser :: [Option] -> [PyStmt] generateOptionParser options = [ Assign (Var "parser") ( Call (Var "argparse.ArgumentParser") [ ArgKeyword "description" $ String "A compiled Futhark program." ] ) ] ++ map parseOption options ++ [ Ass...
1,715
generateOptionParser options = [ Assign (Var "parser") ( Call (Var "argparse.ArgumentParser") [ ArgKeyword "description" $ String "A compiled Futhark program." ] ) ] ++ map parseOption options ++ [ Assign (Var "parser_result") $ Call (...
1,670
true
true
5
15
706
418
217
201
null
null
ruicc/haskell-protocol-buffers
Text/ProtocolBuffers/WireMessage.hs
apache-2.0
getBareMessageWith :: (Default message, ReflectDescriptor message) -- => (WireTag -> FieldId -> WireType -> message -> Get message) -- handle wireTags that are unknown or produce errors => (WireTag -> message -> Get message) -- handle wireTags that are unknown or produce errors ...
1,598
getBareMessageWith :: (Default message, ReflectDescriptor message) -- => (WireTag -> FieldId -> WireType -> message -> Get message) -- handle wireTags that are unknown or produce errors => (WireTag -> message -> Get message) -- handle wireTags that are unknown or produce errors ...
1,530
getBareMessageWith updater = go required initialMessage where go reqs !message | Set.null reqs = go' message | otherwise = do done <- isReallyEmpty if done then notEnoughData else do wireTag <- fmap WireTag getVarInt -- get tag off wire let (_fieldId,wireType) = split...
1,180
true
true
0
17
425
338
165
173
null
null
beni55/text
tests/Tests/Properties.hs
bsd-2-clause
t_dropEnd n = (L.reverse . L.drop n . L.reverse) `eqP` (unpackS . T.dropEnd n)
104
t_dropEnd n = (L.reverse . L.drop n . L.reverse) `eqP` (unpackS . T.dropEnd n)
104
t_dropEnd n = (L.reverse . L.drop n . L.reverse) `eqP` (unpackS . T.dropEnd n)
104
false
false
0
10
39
47
24
23
null
null
luispedro/NGH
Data/NGH/Tests/Align.hs
mit
tests = $(testGroupGenerator)
29
tests = $(testGroupGenerator)
29
tests = $(testGroupGenerator)
29
false
false
0
7
2
14
6
8
null
null
dehun/bce
src/Bce/P2p.hs
mit
clientSendLoop :: Sock.Socket -> PeerAddress -> P2pState -> IO () clientSendLoop sock peerAddr p2p = do chan <- atomically $ dupTChan $ p2pSendChan p2p let loop = do snd <- atomically $ readTChan chan let encodedMsg = encodeMsg $ sendMsg snd case sendDestination snd of Nothing -> d...
1,249
clientSendLoop :: Sock.Socket -> PeerAddress -> P2pState -> IO () clientSendLoop sock peerAddr p2p = do chan <- atomically $ dupTChan $ p2pSendChan p2p let loop = do snd <- atomically $ readTChan chan let encodedMsg = encodeMsg $ sendMsg snd case sendDestination snd of Nothing -> d...
1,249
clientSendLoop sock peerAddr p2p = do chan <- atomically $ dupTChan $ p2pSendChan p2p let loop = do snd <- atomically $ readTChan chan let encodedMsg = encodeMsg $ sendMsg snd case sendDestination snd of Nothing -> do logDebug $ "broadcast towards " ++ show peerAddr ...
1,183
false
true
0
22
557
321
146
175
null
null
mcschroeder/ghc
compiler/iface/IfaceType.hs
bsd-3-clause
pprIfaceForAllCoBndrs :: [(IfLclName, IfaceCoercion)] -> SDoc pprIfaceForAllCoBndrs bndrs = hsep $ map pprIfaceForAllCoBndr bndrs
129
pprIfaceForAllCoBndrs :: [(IfLclName, IfaceCoercion)] -> SDoc pprIfaceForAllCoBndrs bndrs = hsep $ map pprIfaceForAllCoBndr bndrs
129
pprIfaceForAllCoBndrs bndrs = hsep $ map pprIfaceForAllCoBndr bndrs
67
false
true
0
8
13
41
20
21
null
null
lingxiao/CIS700
src/Statistics.hs
bsd-3-clause
roundTo :: Double -> Int -> Double roundTo x n = (fromIntegral (floor (x * t))) / t where t = 10^n -- * source : http://stackoverflow.com/questions/2376981/haskell-types-frustrating-a-simple-average-function
208
roundTo :: Double -> Int -> Double roundTo x n = (fromIntegral (floor (x * t))) / t where t = 10^n -- * source : http://stackoverflow.com/questions/2376981/haskell-types-frustrating-a-simple-average-function
208
roundTo x n = (fromIntegral (floor (x * t))) / t where t = 10^n -- * source : http://stackoverflow.com/questions/2376981/haskell-types-frustrating-a-simple-average-function
173
false
true
0
11
27
64
32
32
null
null
daleooo/barrelfish
tools/flounder/THCBackend.hs
mit
-- Name of the union type holding all the arguments for a message binding_arg_union_type :: String -> String binding_arg_union_type ifn = ifscope ifn "thc_arg_union"
165
binding_arg_union_type :: String -> String binding_arg_union_type ifn = ifscope ifn "thc_arg_union"
99
binding_arg_union_type ifn = ifscope ifn "thc_arg_union"
56
true
true
0
5
23
27
13
14
null
null
llelf/hn
tparse.hs
bsd-3-clause
fields :: [(W, String)] fields = [(S"_id", "sid"), (F (const Null), "th_updated"), (F (const Null), "th_cached"), (F (const Null), "th_created"), (F (const Null), "discussion_id"), (F (const Null), "discussion_sid"), just "domain", just "id", just "num_comments", just "parent_id", ...
519
fields :: [(W, String)] fields = [(S"_id", "sid"), (F (const Null), "th_updated"), (F (const Null), "th_cached"), (F (const Null), "th_created"), (F (const Null), "discussion_id"), (F (const Null), "discussion_sid"), just "domain", just "id", just "num_comments", just "parent_id", ...
519
fields = [(S"_id", "sid"), (F (const Null), "th_updated"), (F (const Null), "th_cached"), (F (const Null), "th_created"), (F (const Null), "discussion_id"), (F (const Null), "discussion_sid"), just "domain", just "id", just "num_comments", just "parent_id", (S"parent_sigid", "par...
495
false
true
0
15
122
251
133
118
null
null
DavidAlphaFox/ghc
libraries/containers/Data/Sequence.hs
bsd-3-clause
addDigits1 m1 (Two a b) c (One d) m2 = appendTree2 m1 (node2 a b) (node2 c d) m2
84
addDigits1 m1 (Two a b) c (One d) m2 = appendTree2 m1 (node2 a b) (node2 c d) m2
84
addDigits1 m1 (Two a b) c (One d) m2 = appendTree2 m1 (node2 a b) (node2 c d) m2
84
false
false
0
7
22
56
27
29
null
null
lynchronan/haskoin-crypto
testsuite/Haskoin/Crypto/Ring/Tests.hs
unlicense
ringFromInteger :: Integer -> Bool ringFromInteger i = runRing ring == fromIntegral model where model = fromInteger i :: Word32 ring = fromInteger i :: Test32
173
ringFromInteger :: Integer -> Bool ringFromInteger i = runRing ring == fromIntegral model where model = fromInteger i :: Word32 ring = fromInteger i :: Test32
173
ringFromInteger i = runRing ring == fromIntegral model where model = fromInteger i :: Word32 ring = fromInteger i :: Test32
138
false
true
3
6
40
54
26
28
null
null
hmemcpy/milewski-ctfp-pdf
src/content/2.3/code/haskell/snippet03.hs
gpl-3.0
2 * 3 = 6
9
2 * 3 = 6
9
2 * 3 = 6
9
false
false
1
5
4
13
5
8
null
null
rueshyna/gogol
gogol-genomics/gen/Network/Google/Genomics/Types/Product.hs
mpl-2.0
-- | If present, return only references which belong to this reference set. sReferenceSetId :: Lens' SearchReferencesRequest (Maybe Text) sReferenceSetId = lens _sReferenceSetId (\ s a -> s{_sReferenceSetId = a})
220
sReferenceSetId :: Lens' SearchReferencesRequest (Maybe Text) sReferenceSetId = lens _sReferenceSetId (\ s a -> s{_sReferenceSetId = a})
144
sReferenceSetId = lens _sReferenceSetId (\ s a -> s{_sReferenceSetId = a})
82
true
true
0
9
37
48
25
23
null
null
yoo-e/weixin-mp-sdk
WeiXin/PublicPlatform/Misc.hs
mit
contentTypeOfAudioFormat :: Text -> Maybe MimeType contentTypeOfAudioFormat "amr" = Just "audio/amr"
102
contentTypeOfAudioFormat :: Text -> Maybe MimeType contentTypeOfAudioFormat "amr" = Just "audio/amr"
102
contentTypeOfAudioFormat "amr" = Just "audio/amr"
51
false
true
0
6
12
24
11
13
null
null
nushio3/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
-- Implicit Parameters ipClassName :: Name ipClassName = clsQual gHC_CLASSES (fsLit "IP") ipClassKey
102
ipClassName :: Name ipClassName = clsQual gHC_CLASSES (fsLit "IP") ipClassKey
79
ipClassName = clsQual gHC_CLASSES (fsLit "IP") ipClassKey
59
true
true
0
7
14
32
14
18
null
null