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
urbanslug/ghc
testsuite/tests/typecheck/should_run/tcrun042.hs
bsd-3-clause
main = print (dropFunction $ e "Meh" (flip const), dropFunction $ e 10 const)
77
main = print (dropFunction $ e "Meh" (flip const), dropFunction $ e 10 const)
77
main = print (dropFunction $ e "Meh" (flip const), dropFunction $ e 10 const)
77
false
false
1
10
13
42
19
23
null
null
rueshyna/gogol
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
mpl-2.0
-- | If set, this indicates the user explicitly chose to opt in or out of -- providing marketing rights to the merchant. If unset, this indicates the -- user has already made this choice in a previous purchase, and was thus -- not shown the marketing right opt in\/out checkbox during the checkout -- flow. Optional. toc...
515
tocExplicitMarketingPreference :: Lens' TestOrderCustomer (Maybe Bool) tocExplicitMarketingPreference = lens _tocExplicitMarketingPreference (\ s a -> s{_tocExplicitMarketingPreference = a})
198
tocExplicitMarketingPreference = lens _tocExplicitMarketingPreference (\ s a -> s{_tocExplicitMarketingPreference = a})
127
true
true
0
8
81
53
29
24
null
null
spechub/Hets
CSL/ReduceProve.hs
gpl-2.0
-- as mkProverTemplate, but with additionally functionality to export lemmas mkProverTemplateWithLemmaExport :: String -> sublogics -> (String -> theory -> [FreeDefMorphism sentence morphism] -> IO ( [ProofStatus proof_tree] , [(Named sentence, ProofStatus proof_tree)])) -> ProverTemplate theory s...
621
mkProverTemplateWithLemmaExport :: String -> sublogics -> (String -> theory -> [FreeDefMorphism sentence morphism] -> IO ( [ProofStatus proof_tree] , [(Named sentence, ProofStatus proof_tree)])) -> ProverTemplate theory sentence morphism sublogics proof_tree mkProverTemplateWithLemmaExport str sl ...
544
mkProverTemplateWithLemmaExport str sl fct = Prover { proverName = str , proverUsable = fmap (either (const Nothing) Just) lookupRedShellCmd , proverSublogic = sl , proveGUI = Just $ \ s t fs -> fct s t fs , proveCMDLautomaticBatch = Nothing }
263
true
true
0
17
123
167
89
78
null
null
Southern-Exposure-Seed-Exchange/Order-Manager-Prototypes
yesod/Application.hs
gpl-3.0
-- | This function allocates resources (such as a database connection pool), -- performs initialization and returns a foundation datatype value. This is also -- the place to put your migrate statements to have automatic database -- migrations handled by Yesod. makeFoundation :: AppSettings -> IO App makeFoundation appS...
1,921
makeFoundation :: AppSettings -> IO App makeFoundation appSettings = do -- Some basic initializations: HTTP connection manager, logger, and static -- subsite. appHttpManager <- newManager appLogger <- newStdoutLoggerSet defaultBufSize >>= makeYesodLogger appStatic <- (if appMutableStatic app...
1,660
makeFoundation appSettings = do -- Some basic initializations: HTTP connection manager, logger, and static -- subsite. appHttpManager <- newManager appLogger <- newStdoutLoggerSet defaultBufSize >>= makeYesodLogger appStatic <- (if appMutableStatic appSettings then staticDevel else static) ...
1,620
true
true
0
12
391
203
105
98
null
null
matthiasgoergens/redgrep
src/Red.hs
bsd-3-clause
prop_float_noincrease :: Re Char String -> Bool prop_float_noincrease re = size (floatFMap re) <= size re
105
prop_float_noincrease :: Re Char String -> Bool prop_float_noincrease re = size (floatFMap re) <= size re
105
prop_float_noincrease re = size (floatFMap re) <= size re
57
false
true
0
8
15
39
18
21
null
null
ekmett/containers
tests/map-properties.hs
bsd-3-clause
prop_fromList :: [Int] -> Bool prop_fromList xs = case fromList (zip xs xs) of t -> t == fromAscList (zip sort_xs sort_xs) && t == fromDistinctAscList (zip nub_sort_xs nub_sort_xs) && t == List.foldr (uncurry insert) empty (zip xs xs) where sort_xs = sort xs nub_sort_xs = List.ma...
418
prop_fromList :: [Int] -> Bool prop_fromList xs = case fromList (zip xs xs) of t -> t == fromAscList (zip sort_xs sort_xs) && t == fromDistinctAscList (zip nub_sort_xs nub_sort_xs) && t == List.foldr (uncurry insert) empty (zip xs xs) where sort_xs = sort xs nub_sort_xs = List.ma...
418
prop_fromList xs = case fromList (zip xs xs) of t -> t == fromAscList (zip sort_xs sort_xs) && t == fromDistinctAscList (zip nub_sort_xs nub_sort_xs) && t == List.foldr (uncurry insert) empty (zip xs xs) where sort_xs = sort xs nub_sort_xs = List.map List.head $ List.group sort_x...
387
false
true
2
15
92
151
69
82
null
null
mrkkrp/stack
src/main/Main.hs
bsd-3-clause
updateCmd :: () -> GlobalOpts -> IO () updateCmd () go = withConfigAndLock go Stack.PackageIndex.updateAllIndices
113
updateCmd :: () -> GlobalOpts -> IO () updateCmd () go = withConfigAndLock go Stack.PackageIndex.updateAllIndices
113
updateCmd () go = withConfigAndLock go Stack.PackageIndex.updateAllIndices
74
false
true
0
8
14
41
20
21
null
null
wildlyinaccurate/lishp
src/Lishp/Primitives.hs
mit
integralBinop op params = mapM unpackIntegral params >>= return . Integer . foldl1 op
92
integralBinop op params = mapM unpackIntegral params >>= return . Integer . foldl1 op
92
integralBinop op params = mapM unpackIntegral params >>= return . Integer . foldl1 op
92
false
false
0
8
20
31
14
17
null
null
Rizary/hackage-matrix-builder
src-lib/Job.hs
gpl-3.0
ec2int :: ExitCode -> Int ec2int ExitSuccess = 0
52
ec2int :: ExitCode -> Int ec2int ExitSuccess = 0
52
ec2int ExitSuccess = 0
26
false
true
0
5
12
18
9
9
null
null
drbean/pdrt-sandbox
src/Data/DRS/Show.hs
apache-2.0
showDRSBox :: DRS -> String showDRSBox (LambdaDRS ((v,d),_)) | not (null d) = v ++ "(" ++ intercalate "," d ++ ")" ++ "\n" | otherwise = v ++ "\n"
154
showDRSBox :: DRS -> String showDRSBox (LambdaDRS ((v,d),_)) | not (null d) = v ++ "(" ++ intercalate "," d ++ ")" ++ "\n" | otherwise = v ++ "\n"
154
showDRSBox (LambdaDRS ((v,d),_)) | not (null d) = v ++ "(" ++ intercalate "," d ++ ")" ++ "\n" | otherwise = v ++ "\n"
126
false
true
1
10
37
84
42
42
null
null
Mahdi89/eTeak
src/Type.hs
bsd-3-clause
isTokenValueExpr :: [Context Decl] -> Expr -> Bool isTokenValueExpr cs (ValueExpr _ typ (IntValue 0)) = widthOfType cs typ == 0
131
isTokenValueExpr :: [Context Decl] -> Expr -> Bool isTokenValueExpr cs (ValueExpr _ typ (IntValue 0)) = widthOfType cs typ == 0
127
isTokenValueExpr cs (ValueExpr _ typ (IntValue 0)) = widthOfType cs typ == 0
76
false
true
0
9
24
55
27
28
null
null
etcinit/hakyll-serve
src/Network/Wai/Serve/Middleware.hs
bsd-3-clause
showDirective (MediaSrc xs) = dt "media-src" xs
47
showDirective (MediaSrc xs) = dt "media-src" xs
47
showDirective (MediaSrc xs) = dt "media-src" xs
47
false
false
0
7
6
20
9
11
null
null
jfischoff/hs-mitsuba
tests/Tests/Mitsuba/Types.hs
bsd-3-clause
case_sunsky_toXML = actualSunSky `assertElement` [xmlQQ| <emitter type="sunsky"> <float name="turbidity" value="1.0"/> <spectrum name="albedo" value="2.0"/> <integer name="year" value="3"/> <integer name="month" value="4"/> <integer name="day" value="5"/> <float ...
893
case_sunsky_toXML = actualSunSky `assertElement` [xmlQQ| <emitter type="sunsky"> <float name="turbidity" value="1.0"/> <spectrum name="albedo" value="2.0"/> <integer name="year" value="3"/> <integer name="month" value="4"/> <integer name="day" value="5"/> <float ...
893
case_sunsky_toXML = actualSunSky `assertElement` [xmlQQ| <emitter type="sunsky"> <float name="turbidity" value="1.0"/> <spectrum name="albedo" value="2.0"/> <integer name="year" value="3"/> <integer name="month" value="4"/> <integer name="day" value="5"/> <float ...
893
false
false
1
5
214
19
11
8
null
null
jsnajder/counts
src/Data/Counts.hs
bsd-3-clause
size :: Counts a -> Int size = M.size . counts_
47
size :: Counts a -> Int size = M.size . counts_
47
size = M.size . counts_
23
false
true
0
6
10
24
12
12
null
null
nbloomf/carl
test/Tests/Lib/Struct/Matrix.hs
gpl-3.0
arbMatDim :: (Arbitrary a) => Integer -> Integer -> Gen (Matrix a) arbMatDim r c = do as <- vectorOf ((fromIntegral r)*(fromIntegral c)) arbitrary case mRowMajorFromList r c as of Left _ -> return Null Right m -> return m
234
arbMatDim :: (Arbitrary a) => Integer -> Integer -> Gen (Matrix a) arbMatDim r c = do as <- vectorOf ((fromIntegral r)*(fromIntegral c)) arbitrary case mRowMajorFromList r c as of Left _ -> return Null Right m -> return m
234
arbMatDim r c = do as <- vectorOf ((fromIntegral r)*(fromIntegral c)) arbitrary case mRowMajorFromList r c as of Left _ -> return Null Right m -> return m
167
false
true
0
12
52
111
52
59
null
null
genos/online_problems
advent_of_code_2021/day18/Main.hs
mit
split :: SnailfishNumber -> Maybe SnailfishNumber split (Leaf n) | n < 10 = Nothing | otherwise = Just $ Node (Leaf n') (Leaf n'') where n' = n `div` 2 n'' = (n + 1) `div` 2
197
split :: SnailfishNumber -> Maybe SnailfishNumber split (Leaf n) | n < 10 = Nothing | otherwise = Just $ Node (Leaf n') (Leaf n'') where n' = n `div` 2 n'' = (n + 1) `div` 2
197
split (Leaf n) | n < 10 = Nothing | otherwise = Just $ Node (Leaf n') (Leaf n'') where n' = n `div` 2 n'' = (n + 1) `div` 2
147
false
true
0
9
61
99
50
49
null
null
Southern-Exposure-Seed-Exchange/southernexposure.com
server/src/Images.hs
gpl-3.0
imageDirectory :: ImageSize -> FilePath imageDirectory s = "width-" <> show (sizeWidth s)
89
imageDirectory :: ImageSize -> FilePath imageDirectory s = "width-" <> show (sizeWidth s)
89
imageDirectory s = "width-" <> show (sizeWidth s)
49
false
true
0
8
12
31
15
16
null
null
conal/reification-rules
src/ReificationRules/FOS.hs
bsd-3-clause
{-------------------------------------------------------------------- Tests --------------------------------------------------------------------} -- Needs fixing for FOS app1 :: p (a -> b) -> E p a -> E p b app1 p = (ConstE p :^)
235
app1 :: p (a -> b) -> E p a -> E p b app1 p = (ConstE p :^)
59
app1 p = (ConstE p :^)
22
true
true
0
8
33
55
27
28
null
null
copland/cmdargs
System/Console/CmdArgs/Implicit/Local.hs
bsd-3-clause
modeAnn ModeDefault x = x{modeDefault=True}
43
modeAnn ModeDefault x = x{modeDefault=True}
43
modeAnn ModeDefault x = x{modeDefault=True}
43
false
false
0
6
4
19
10
9
null
null
gnn/Hets
Common/Id.hs
gpl-2.0
-- | show a position showPos :: Pos -> ShowS showPos p = let name = sourceName p line = sourceLine p column = sourceColumn p in noShow (null name) (showString name . showChar ':') . noShow (line == 0 && column == 0) (shows line . showC...
343
showPos :: Pos -> ShowS showPos p = let name = sourceName p line = sourceLine p column = sourceColumn p in noShow (null name) (showString name . showChar ':') . noShow (line == 0 && column == 0) (shows line . showChar '.' . shows colum...
322
showPos p = let name = sourceName p line = sourceLine p column = sourceColumn p in noShow (null name) (showString name . showChar ':') . noShow (line == 0 && column == 0) (shows line . showChar '.' . shows column)
298
true
true
0
12
136
117
56
61
null
null
michaelficarra/purescript
src/Language/PureScript/Parser/Lexer.hs
mit
parseToken :: P.Parsec String u Token parseToken = P.choice [ P.try $ P.string "<-" *> P.notFollowedBy symbolChar *> pure LArrow , P.try $ P.string "<=" *> P.notFollowedBy symbolChar *> pure LFatArrow , P.try $ P.string "->" *> P.notFollowedBy symbolChar *> pure RArrow , P.try $ P.string "=>" *> P.notFollowedBy...
3,128
parseToken :: P.Parsec String u Token parseToken = P.choice [ P.try $ P.string "<-" *> P.notFollowedBy symbolChar *> pure LArrow , P.try $ P.string "<=" *> P.notFollowedBy symbolChar *> pure LFatArrow , P.try $ P.string "->" *> P.notFollowedBy symbolChar *> pure RArrow , P.try $ P.string "=>" *> P.notFollowedBy...
3,128
parseToken = P.choice [ P.try $ P.string "<-" *> P.notFollowedBy symbolChar *> pure LArrow , P.try $ P.string "<=" *> P.notFollowedBy symbolChar *> pure LFatArrow , P.try $ P.string "->" *> P.notFollowedBy symbolChar *> pure RArrow , P.try $ P.string "=>" *> P.notFollowedBy symbolChar *> pure RFatArrow , P.tr...
3,090
false
true
2
14
716
1,083
529
554
null
null
parvmor/codeworld
funblocks-server/src/Funblocks.hs
apache-2.0
deleteProjectHandler :: ClientId -> Snap () deleteProjectHandler clientId = do mode <- getBuildMode user <- getUser clientId Just name <- getParam "name" let projectName = T.decodeUtf8 name let projectId = nameToProjectId projectName Just path <- fmap (splitDirectories . BC.unpack) <$>...
875
deleteProjectHandler :: ClientId -> Snap () deleteProjectHandler clientId = do mode <- getBuildMode user <- getUser clientId Just name <- getParam "name" let projectName = T.decodeUtf8 name let projectId = nameToProjectId projectName Just path <- fmap (splitDirectories . BC.unpack) <$>...
875
deleteProjectHandler clientId = do mode <- getBuildMode user <- getUser clientId Just name <- getParam "name" let projectName = T.decodeUtf8 name let projectId = nameToProjectId projectName Just path <- fmap (splitDirectories . BC.unpack) <$> getParam "path" let dirIds = map (nameT...
831
false
true
0
15
210
298
137
161
null
null
rueshyna/gogol
gogol-admin-directory/gen/Network/Google/Directory/Types.hs
mpl-2.0
-- | View and manage notifications received on your domain adminDirectoryNotificationsScope :: Proxy '["https://www.googleapis.com/auth/admin.directory.notifications"] adminDirectoryNotificationsScope = Proxy
208
adminDirectoryNotificationsScope :: Proxy '["https://www.googleapis.com/auth/admin.directory.notifications"] adminDirectoryNotificationsScope = Proxy
149
adminDirectoryNotificationsScope = Proxy
40
true
true
0
8
16
26
12
14
null
null
da-x/Algorithm-W-Step-By-Step
Lamdu/Expr/Lens.hs
gpl-3.0
_BApp :: Prism' (V.Body a) (V.Apply a) _BApp = prism' V.BApp get where get (V.BApp x) = Just x get _ = Nothing
132
_BApp :: Prism' (V.Body a) (V.Apply a) _BApp = prism' V.BApp get where get (V.BApp x) = Just x get _ = Nothing
132
_BApp = prism' V.BApp get where get (V.BApp x) = Just x get _ = Nothing
93
false
true
0
10
44
68
33
35
null
null
bobgru/conifer
test/unit-tests/matrixTests.hs
bsd-3-clause
accumSolution_lastRowNonEmptySln = (accumSolution [3] [4,2]) `compare` [3,-10] @?= EQ
85
accumSolution_lastRowNonEmptySln = (accumSolution [3] [4,2]) `compare` [3,-10] @?= EQ
85
accumSolution_lastRowNonEmptySln = (accumSolution [3] [4,2]) `compare` [3,-10] @?= EQ
85
false
false
0
9
8
41
24
17
null
null
snoyberg/haskell-impatient-poker-players
src/Lesson06.hs
mit
-- Once we have that helper functions, writing a flush checking function is -- pretty easy. flush cards = if isFlush cards then return (Flush (cardRanks cards)) else []
188
flush cards = if isFlush cards then return (Flush (cardRanks cards)) else []
96
flush cards = if isFlush cards then return (Flush (cardRanks cards)) else []
96
true
false
0
10
48
39
20
19
null
null
prashant007/AMPL
myAMPL/src/TEMP/Printparser.hs
mit
mkEsc :: Char -> Char -> ShowS mkEsc q s = case s of _ | s == q -> showChar '\\' . showChar s '\\'-> showString "\\\\" '\n' -> showString "\\n" '\t' -> showString "\\t" _ -> showChar s
194
mkEsc :: Char -> Char -> ShowS mkEsc q s = case s of _ | s == q -> showChar '\\' . showChar s '\\'-> showString "\\\\" '\n' -> showString "\\n" '\t' -> showString "\\t" _ -> showChar s
194
mkEsc q s = case s of _ | s == q -> showChar '\\' . showChar s '\\'-> showString "\\\\" '\n' -> showString "\\n" '\t' -> showString "\\t" _ -> showChar s
163
false
true
0
11
49
90
41
49
null
null
Javran/misc
async-resource/src/Main.hs
mit
main :: IO () main = do result <- newResumableSource (infiniteProduce (0 :: Int)) $$+- debugSink 4 print result pure ()
131
main :: IO () main = do result <- newResumableSource (infiniteProduce (0 :: Int)) $$+- debugSink 4 print result pure ()
131
main = do result <- newResumableSource (infiniteProduce (0 :: Int)) $$+- debugSink 4 print result pure ()
117
false
true
0
12
32
59
27
32
null
null
jhstanton/haskellator
examples/MIPs/MIPs/Disassemble.hs
bsd-3-clause
-- TODO: Implement instructions that involve shamt showDisassembled :: MInstruction -> String showDisassembled (R d s t shamt f) = fName ++ " " ++ commaSeparate (map showRegister [d, s, t]) where fName = map toLower (show f) hasShamt = False -- For now
267
showDisassembled :: MInstruction -> String showDisassembled (R d s t shamt f) = fName ++ " " ++ commaSeparate (map showRegister [d, s, t]) where fName = map toLower (show f) hasShamt = False -- For now
216
showDisassembled (R d s t shamt f) = fName ++ " " ++ commaSeparate (map showRegister [d, s, t]) where fName = map toLower (show f) hasShamt = False -- For now
173
true
true
0
9
58
86
45
41
null
null
jprider63/LMonad-Yesod
src/Database/LPersist.hs
mit
raiseLabelRead :: (Label l, LMonad m, LEntity l e) => Entity e -> LMonadT l m () raiseLabelRead e = taintLabel $ getLabelRead e
127
raiseLabelRead :: (Label l, LMonad m, LEntity l e) => Entity e -> LMonadT l m () raiseLabelRead e = taintLabel $ getLabelRead e
127
raiseLabelRead e = taintLabel $ getLabelRead e
46
false
true
0
8
23
60
29
31
null
null
diku-dk/futhark
src/Futhark/Optimise/Fusion/LoopKernel.hs
isc
liftMaybe (Just x) = return x
29
liftMaybe (Just x) = return x
29
liftMaybe (Just x) = return x
29
false
false
0
7
5
18
8
10
null
null
luisgepeto/HaskellLearning
04 Syntax In Functions/01_pattern_matching.hs
mit
--without patterns function = [fst x + snd x | x <- xs]
57
function = [fst x + snd x | x <- xs]
36
function = [fst x + snd x | x <- xs]
36
true
false
1
8
14
32
14
18
null
null
TomMD/cryptol
src/Cryptol/ModuleSystem/Monad.hs
bsd-3-clause
typeCheckWarnings :: [(Range,T.Warning)] -> ModuleM () typeCheckWarnings ws | null ws = return () | otherwise = warn [TypeCheckWarnings ws]
145
typeCheckWarnings :: [(Range,T.Warning)] -> ModuleM () typeCheckWarnings ws | null ws = return () | otherwise = warn [TypeCheckWarnings ws]
145
typeCheckWarnings ws | null ws = return () | otherwise = warn [TypeCheckWarnings ws]
90
false
true
1
8
25
64
31
33
null
null
kini/ghc-server
src/Server/Client.hs
bsd-3-clause
hPutLn :: Handle -> L.ByteString -> IO () hPutLn h ps = L.hPut h ps >> L.hPut h (L.singleton 0x0a)
98
hPutLn :: Handle -> L.ByteString -> IO () hPutLn h ps = L.hPut h ps >> L.hPut h (L.singleton 0x0a)
98
hPutLn h ps = L.hPut h ps >> L.hPut h (L.singleton 0x0a)
56
false
true
0
9
19
57
27
30
null
null
nickbart1980/pandoc
src/Text/Pandoc/Writers/ConTeXt.hs
gpl-2.0
inlineToConTeXt (Math InlineMath str) = return $ char '$' <> text str <> char '$'
83
inlineToConTeXt (Math InlineMath str) = return $ char '$' <> text str <> char '$'
83
inlineToConTeXt (Math InlineMath str) = return $ char '$' <> text str <> char '$'
83
false
false
6
6
16
42
17
25
null
null
meiersi/scyther-proof
src/Scyther/Facts.hs
gpl-3.0
-- | Set the equality that has to be solved for the case to be complete. setFinalEq :: E.MsgEq -> ChainRuleM () setFinalEq eq = modify $ \crs -> crs { crsFinalEq = Just eq }
173
setFinalEq :: E.MsgEq -> ChainRuleM () setFinalEq eq = modify $ \crs -> crs { crsFinalEq = Just eq }
100
setFinalEq eq = modify $ \crs -> crs { crsFinalEq = Just eq }
61
true
true
2
9
35
52
25
27
null
null
fpco/hlint
data/Default.hs
bsd-3-clause
error = maybe False (const True) ==> Data.Maybe.isJust
54
error = maybe False (const True) ==> Data.Maybe.isJust
54
error = maybe False (const True) ==> Data.Maybe.isJust
54
false
false
2
6
7
28
12
16
null
null
MaxOw/awesomium
src/Graphics/UI/Awesomium/Resource.hs
lgpl-3.0
-- | Get the URL associated with this request. requestGetUrl :: ResourceRequest -> IO String requestGetUrl = awe_resource_request_get_url
137
requestGetUrl :: ResourceRequest -> IO String requestGetUrl = awe_resource_request_get_url
90
requestGetUrl = awe_resource_request_get_url
44
true
true
0
7
17
25
11
14
null
null
zyla/rybu
test/EvalSpec.hs
bsd-3-clause
spec :: Spec spec = do describe "inRange" $ do let test = testF "inRange" (\(typ, val) -> inRange typ val) it "integers" $ do test (Range 1 3, Int 0) False test (Range 1 3, Int 1) True test (Range 1 3, Int 2) True test (Range 1 3, Int 3) True ...
4,212
spec :: Spec spec = do describe "inRange" $ do let test = testF "inRange" (\(typ, val) -> inRange typ val) it "integers" $ do test (Range 1 3, Int 0) False test (Range 1 3, Int 1) True test (Range 1 3, Int 2) True test (Range 1 3, Int 3) True ...
4,212
spec = do describe "inRange" $ do let test = testF "inRange" (\(typ, val) -> inRange typ val) it "integers" $ do test (Range 1 3, Int 0) False test (Range 1 3, Int 1) True test (Range 1 3, Int 2) True test (Range 1 3, Int 3) True test (Ran...
4,199
false
true
0
19
1,646
1,738
808
930
null
null
brendanhay/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/CourseWorkMaterials/Get.hs
mpl-2.0
-- | JSONP ccwmgCallback :: Lens' CoursesCourseWorkMaterialsGet (Maybe Text) ccwmgCallback = lens _ccwmgCallback (\ s a -> s{_ccwmgCallback = a})
153
ccwmgCallback :: Lens' CoursesCourseWorkMaterialsGet (Maybe Text) ccwmgCallback = lens _ccwmgCallback (\ s a -> s{_ccwmgCallback = a})
142
ccwmgCallback = lens _ccwmgCallback (\ s a -> s{_ccwmgCallback = a})
76
true
true
0
9
27
48
25
23
null
null
olsner/ghc
libraries/ghci/GHCi/Run.hs
bsd-3-clause
noBreakAction :: BreakpointCallback noBreakAction _ _ False _ = putStrLn "*** Ignoring breakpoint"
98
noBreakAction :: BreakpointCallback noBreakAction _ _ False _ = putStrLn "*** Ignoring breakpoint"
98
noBreakAction _ _ False _ = putStrLn "*** Ignoring breakpoint"
62
false
true
0
5
12
23
11
12
null
null
GaloisInc/mistral
src/Mistral/Utils/Source.hs
bsd-3-clause
range :: Source -> Maybe Range range loc = case loc of Source _ r -> Just r NoSource r -> Just r _ -> Nothing -- Located Things --------------------------------------------------------------
207
range :: Source -> Maybe Range range loc = case loc of Source _ r -> Just r NoSource r -> Just r _ -> Nothing -- Located Things --------------------------------------------------------------
207
range loc = case loc of Source _ r -> Just r NoSource r -> Just r _ -> Nothing -- Located Things --------------------------------------------------------------
176
false
true
0
8
46
63
28
35
null
null
UCSD-PL/RefScript
src/Language/Rsc/Pretty/Syntax.hs
bsd-3-clause
ppEnumElt (EnumElt _ (Id _ str) e) = text str <+> text "=" <+> ppExpression True e
82
ppEnumElt (EnumElt _ (Id _ str) e) = text str <+> text "=" <+> ppExpression True e
82
ppEnumElt (EnumElt _ (Id _ str) e) = text str <+> text "=" <+> ppExpression True e
82
false
false
0
9
16
46
21
25
null
null
JacquesCarette/literate-scientific-software
code/drasil-data/Data/Drasil/SI_Units.hs
bsd-2-clause
radian = derCUC' "radian" "radian" "angle" (Label "rad") (metre /: metre)
76
radian = derCUC' "radian" "radian" "angle" (Label "rad") (metre /: metre)
76
radian = derCUC' "radian" "radian" "angle" (Label "rad") (metre /: metre)
76
false
false
1
7
13
37
15
22
null
null
GaloisInc/saw-script
src/SAWScript/Crucible/LLVM/ResolveSetupValue.hs
bsd-3-clause
memArrayToSawCoreTerm :: Crucible.HasPtrWidth (Crucible.ArchWidth arch) => LLVMCrucibleContext arch -> Crucible.EndianForm -> TypedTerm -> IO Term memArrayToSawCoreTerm crucible_context endianess typed_term = do let sym = crucible_context ^. ccSym let data_layout = Crucible.llvmDataLayout $ ccTypeCtx cruc...
4,697
memArrayToSawCoreTerm :: Crucible.HasPtrWidth (Crucible.ArchWidth arch) => LLVMCrucibleContext arch -> Crucible.EndianForm -> TypedTerm -> IO Term memArrayToSawCoreTerm crucible_context endianess typed_term = do let sym = crucible_context ^. ccSym let data_layout = Crucible.llvmDataLayout $ ccTypeCtx cruc...
4,697
memArrayToSawCoreTerm crucible_context endianess typed_term = do let sym = crucible_context ^. ccSym let data_layout = Crucible.llvmDataLayout $ ccTypeCtx crucible_context st <- sawCoreState sym let saw_context = saw_ctx st byte_type_term <- importType saw_context emptyEnv $ Cryptol.tValTy $ Cryptol.TVSeq 8 ...
4,540
false
true
7
19
1,480
1,054
504
550
null
null
duplode/threepenny-gui
src/Graphics/UI/Threepenny/Events.hs
bsd-3-clause
{----------------------------------------------------------------------------- Events ------------------------------------------------------------------------------} -- | Event that occurs when the /user/ changes the value of the input element. valueChange :: Element -> Event String valueChange el = unsafeMapUI el ...
366
valueChange :: Element -> Event String valueChange el = unsafeMapUI el (const $ get value el) (domEvent "keydown" el)
117
valueChange el = unsafeMapUI el (const $ get value el) (domEvent "keydown" el)
78
true
true
0
8
40
53
26
27
null
null
badp/ganeti
src/Ganeti/OpCodes.hs
gpl-2.0
opSummaryVal _ = Nothing
24
opSummaryVal _ = Nothing
24
opSummaryVal _ = Nothing
24
false
false
0
4
3
10
4
6
null
null
apyrgio/ganeti
src/Ganeti/Utils/Validate.hs
bsd-2-clause
-- | An utility function that emits a single message into a validation monad. report :: (Monad m) => String -> ValidationMonadT m () report = ValidationMonad . tell . singleton
176
report :: (Monad m) => String -> ValidationMonadT m () report = ValidationMonad . tell . singleton
98
report = ValidationMonad . tell . singleton
43
true
true
0
8
30
40
21
19
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/CanvasRenderingContext2D.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.webkitLineDashOffset Mozilla CanvasRenderingContext2D.webkitLineDashOffset documentation> setWebkitLineDashOffset :: (MonadDOM m) => CanvasRenderingContext2D -> Float -> m () setWebkitLineDashOffset self val = lif...
375
setWebkitLineDashOffset :: (MonadDOM m) => CanvasRenderingContext2D -> Float -> m () setWebkitLineDashOffset self val = liftDOM (self ^. jss "webkitLineDashOffset" (toJSVal val))
204
setWebkitLineDashOffset self val = liftDOM (self ^. jss "webkitLineDashOffset" (toJSVal val))
95
true
true
0
10
54
60
30
30
null
null
dillonhuff/PlayingCards
src/PlayingCards/Deck.hs
bsd-3-clause
four = Four
11
four = Four
11
four = Four
11
false
false
1
5
2
10
3
7
null
null
AlexanderPankiv/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
assignMem_IntCode pk addr src = do is32Bit <- is32BitPlatform Amode addr code_addr <- getAmode addr (code_src, op_src) <- get_op_RI is32Bit src let code = code_src `appOL` code_addr `snocOL` MOV pk op_src (OpAddr addr) -- NOTE: op_src is stable, so it w...
877
assignMem_IntCode pk addr src = do is32Bit <- is32BitPlatform Amode addr code_addr <- getAmode addr (code_src, op_src) <- get_op_RI is32Bit src let code = code_src `appOL` code_addr `snocOL` MOV pk op_src (OpAddr addr) -- NOTE: op_src is stable, so it w...
877
assignMem_IntCode pk addr src = do is32Bit <- is32BitPlatform Amode addr code_addr <- getAmode addr (code_src, op_src) <- get_op_RI is32Bit src let code = code_src `appOL` code_addr `snocOL` MOV pk op_src (OpAddr addr) -- NOTE: op_src is stable, so it w...
877
false
false
1
13
264
218
106
112
null
null
mightymoose/liquidhaskell
benchmarks/text-0.11.2.3/Data/Text/Encoding/Fusion.hs
bsd-3-clause
-- | /O(n)/ Convert a 'ByteString' into a 'Stream Char', using little -- endian UTF-32 encoding. streamUtf32LE :: OnDecodeError -> ByteString -> Stream Char streamUtf32LE onErr bs = Stream next 0 (maxSize (l `shiftR` 2)) where l = B.length bs {-# INLINE next #-} next i | i >= l ...
754
streamUtf32LE :: OnDecodeError -> ByteString -> Stream Char streamUtf32LE onErr bs = Stream next 0 (maxSize (l `shiftR` 2)) where l = B.length bs {-# INLINE next #-} next i | i >= l = Done | i+3 < l && U32.validate x = Yield (unsafeChr32 x) (i+4) | ...
657
streamUtf32LE onErr bs = Stream next 0 (maxSize (l `shiftR` 2)) where l = B.length bs {-# INLINE next #-} next i | i >= l = Done | i+3 < l && U32.validate x = Yield (unsafeChr32 x) (i+4) | otherwise = decodeError "streamUtf32LE" "UTF-32LE" onErr Not...
597
true
true
0
12
287
255
128
127
null
null
ezyang/ghc
testsuite/tests/typecheck/should_fail/TcCoercibleFail.hs
bsd-3-clause
foo1 = coerce $ one :: ()
25
foo1 = coerce $ one :: ()
25
foo1 = coerce $ one :: ()
25
false
false
0
5
6
15
8
7
null
null
TristanAllwood/lazyCrossCheck
LazyCrossCheck/Eval.hs
bsd-3-clause
_ ~~> _ = False
15
_ ~~> _ = False
15
_ ~~> _ = False
15
false
false
0
5
4
12
5
7
null
null
Delapouite/dotfiles
link/.xmonad/xmonad.lafayette.hs
mit
-- Mouse bindings: default actions bound to mouse events myMouseBindings XConfig {XMonad.modMask = modm} = fromList -- mod-button1, Set the window to floating mode and move by dragging [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster) -- mod-...
631
myMouseBindings XConfig {XMonad.modMask = modm} = fromList -- mod-button1, Set the window to floating mode and move by dragging [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster) -- mod-button2, Raise the window to the top of the stack , ((m...
574
myMouseBindings XConfig {XMonad.modMask = modm} = fromList -- mod-button1, Set the window to floating mode and move by dragging [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster) -- mod-button2, Raise the window to the top of the stack , ((m...
574
true
false
0
10
180
137
75
62
null
null
Alxandr/Phidoc
src/Text/Phidoc/Walk.hs
bsd-3-clause
validImport ('#':_) = False
27
validImport ('#':_) = False
27
validImport ('#':_) = False
27
false
false
0
7
3
16
8
8
null
null
paluh/systemd-config
src/System/Systemd/Config/Networkd/Network.hs
bsd-3-clause
showArchitecture Alpha = "alpha"
32
showArchitecture Alpha = "alpha"
32
showArchitecture Alpha = "alpha"
32
false
false
1
5
3
13
4
9
null
null
OS2World/DEV-UTIL-HUGS
demos/GLUT/examples/RedBook/Hello.hs
bsd-3-clause
display :: DisplayCallback display = do -- clear all pixels clear [ ColorBuffer ] -- draw white polygon (rectangle) with corners at -- (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0) color (Color3 1.0 1.0 (1.0 :: GLfloat)) -- resolve overloading, not needed in "real" programs let vertex3f = vertex :: Vert...
578
display :: DisplayCallback display = do -- clear all pixels clear [ ColorBuffer ] -- draw white polygon (rectangle) with corners at -- (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0) color (Color3 1.0 1.0 (1.0 :: GLfloat)) -- resolve overloading, not needed in "real" programs let vertex3f = vertex :: Vert...
578
display = do -- clear all pixels clear [ ColorBuffer ] -- draw white polygon (rectangle) with corners at -- (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0) color (Color3 1.0 1.0 (1.0 :: GLfloat)) -- resolve overloading, not needed in "real" programs let vertex3f = vertex :: Vertex3 GLfloat -> IO () ren...
551
false
true
0
12
145
137
66
71
null
null
sdiehl/ghc
compiler/GHC/Hs/Expr.hs
bsd-3-clause
pprStmtContext MonadComp = text "monad comprehension"
59
pprStmtContext MonadComp = text "monad comprehension"
59
pprStmtContext MonadComp = text "monad comprehension"
59
false
false
0
5
11
12
5
7
null
null
yanhan/bin-src
tests/BinSrc/GitUtils/Tests.hs
bsd-3-clause
tests :: Test tests = testGroup "truncate_colorized_line" [ testCase "does not truncate a line shorter than the terminal width" assert_notruncate_lt_terminal_width , testCase "does not truncate a line equal to the terminal width" assert_notruncate_eq_terminal_width , testCase "truncates a li...
1,287
tests :: Test tests = testGroup "truncate_colorized_line" [ testCase "does not truncate a line shorter than the terminal width" assert_notruncate_lt_terminal_width , testCase "does not truncate a line equal to the terminal width" assert_notruncate_eq_terminal_width , testCase "truncates a li...
1,287
tests = testGroup "truncate_colorized_line" [ testCase "does not truncate a line shorter than the terminal width" assert_notruncate_lt_terminal_width , testCase "does not truncate a line equal to the terminal width" assert_notruncate_eq_terminal_width , testCase "truncates a line longer than...
1,273
false
true
0
7
245
96
45
51
null
null
DataStewardshipPortal/ds-wizard
DSServer/app/Persistence/Session.hs
apache-2.0
createSession :: User -> PG.Connection -> IO (Maybe SessionId) createSession user conn = do now <- liftIO DTC.getCurrentTime sessionId <- genKey let validUntil = DTC.addUTCTime (5 * 3600) now r <- PG.query conn "INSERT INTO \"Session\" (session_id, user_id, valid_until) VALUES (?, ?, ?) RETURNING session_id" ...
559
createSession :: User -> PG.Connection -> IO (Maybe SessionId) createSession user conn = do now <- liftIO DTC.getCurrentTime sessionId <- genKey let validUntil = DTC.addUTCTime (5 * 3600) now r <- PG.query conn "INSERT INTO \"Session\" (session_id, user_id, valid_until) VALUES (?, ?, ?) RETURNING session_id" ...
559
createSession user conn = do now <- liftIO DTC.getCurrentTime sessionId <- genKey let validUntil = DTC.addUTCTime (5 * 3600) now r <- PG.query conn "INSERT INTO \"Session\" (session_id, user_id, valid_until) VALUES (?, ?, ?) RETURNING session_id" (sessionId, u_user_id user, validUntil) :: IO [PG.Only S...
496
false
true
5
10
140
186
93
93
null
null
harendra-kumar/asyncly
test/Prop.hs
bsd-3-clause
main :: IO () main = hspec $ H.parallel #ifdef COVERAGE_BUILD $ modifyMaxSuccess (const 10) #endif $ do let folded :: IsStream t => [a] -> t IO a folded = serially . (\xs -> case xs of [x] -> return x -- singleton stream case _ -> S.foldMapWith (<>) re...
19,307
main :: IO () main = hspec $ H.parallel #ifdef COVERAGE_BUILD $ modifyMaxSuccess (const 10) #endif $ do let folded :: IsStream t => [a] -> t IO a folded = serially . (\xs -> case xs of [x] -> return x -- singleton stream case _ -> S.foldMapWith (<>) re...
19,307
main = hspec $ H.parallel #ifdef COVERAGE_BUILD $ modifyMaxSuccess (const 10) #endif $ do let folded :: IsStream t => [a] -> t IO a folded = serially . (\xs -> case xs of [x] -> return x -- singleton stream case _ -> S.foldMapWith (<>) return xs ...
19,293
false
true
6
17
4,935
4,581
2,175
2,406
null
null
MgaMPKAy/language-sh
Language/Sh/Expansion.hs
bsd-3-clause
f <=< g = \a -> g a >>= f
25
f <=< g = \a -> g a >>= f
25
f <=< g = \a -> g a >>= f
25
false
false
3
7
9
26
13
13
null
null
alexander-at-github/eta
compiler/ETA/TypeCheck/TcRnTypes.hs
bsd-3-clause
pprTcTyThingCategory (AThing {}) = ptext (sLit "Kinded thing")
69
pprTcTyThingCategory (AThing {}) = ptext (sLit "Kinded thing")
69
pprTcTyThingCategory (AThing {}) = ptext (sLit "Kinded thing")
69
false
false
0
7
14
25
12
13
null
null
henrytill/deviser
tests/Deviser/Parser/Tests.hs
bsd-3-clause
parseString :: Test parseString = Expect "Parse a string" (==) (Right (String "goliath")) (readExpr "\"goliath\"")
143
parseString :: Test parseString = Expect "Parse a string" (==) (Right (String "goliath")) (readExpr "\"goliath\"")
143
parseString = Expect "Parse a string" (==) (Right (String "goliath")) (readExpr "\"goliath\"")
123
false
true
0
9
43
40
21
19
null
null
mightymoose/liquidhaskell
tests/pos/TopLevel.hs
bsd-3-clause
foo b = liquidAssertB b
23
foo b = liquidAssertB b
23
foo b = liquidAssertB b
23
false
false
0
5
4
12
5
7
null
null
bovinespirit/enummapmap
test/EnumMapSetVsIntSet.hs
bsd-3-clause
runPropL2 :: (IS.IntSet -> IS.IntSet) -> (TestSet2 -> TestSet2) -> Int -> [Int] -> Bool runPropL2 f g k1 = runProp2 (list2l2 k1 . IS.toList . f) (EMS.toList . g) k1
204
runPropL2 :: (IS.IntSet -> IS.IntSet) -> (TestSet2 -> TestSet2) -> Int -> [Int] -> Bool runPropL2 f g k1 = runProp2 (list2l2 k1 . IS.toList . f) (EMS.toList . g) k1
204
runPropL2 f g k1 = runProp2 (list2l2 k1 . IS.toList . f) (EMS.toList . g) k1
80
false
true
0
10
70
93
46
47
null
null
MichaelBurge/stockfighter-jailbreak
src/Api/Stockfighter/Jailbreak/Decompiler/Passes.hs
bsd-3-clause
replaceBranchesWithJumps :: [Statement] -> Maybe [ Statement ] replaceBranchesWithJumps stmts = case stmts of (SAsm x (iex_astI -> Or r1 r2): SAsm y (iex_astI -> Breq relptr):[]) -> withPair r1 r2 $ \r16 -> let (label, goto) = labelAndGotoForRelptr y relptr in Just [ label, SIfElse x (EUnop Not $ EReg...
1,273
replaceBranchesWithJumps :: [Statement] -> Maybe [ Statement ] replaceBranchesWithJumps stmts = case stmts of (SAsm x (iex_astI -> Or r1 r2): SAsm y (iex_astI -> Breq relptr):[]) -> withPair r1 r2 $ \r16 -> let (label, goto) = labelAndGotoForRelptr y relptr in Just [ label, SIfElse x (EUnop Not $ EReg...
1,273
replaceBranchesWithJumps stmts = case stmts of (SAsm x (iex_astI -> Or r1 r2): SAsm y (iex_astI -> Breq relptr):[]) -> withPair r1 r2 $ \r16 -> let (label, goto) = labelAndGotoForRelptr y relptr in Just [ label, SIfElse x (EUnop Not $ EReg16 r16) goto (SBlock y []) ] (SAsm x (iex_astI -> Or r1 r2)...
1,210
false
true
0
19
286
647
322
325
null
null
christiaanb/Idris-dev
src/Core/CaseTree.hs
bsd-3-clause
-- Find all directly used arguments (i.e. used but not in function calls) findUsedArgs :: SC -> [Name] -> [Name] findUsedArgs sc topargs = nub (findAllUsedArgs sc topargs)
172
findUsedArgs :: SC -> [Name] -> [Name] findUsedArgs sc topargs = nub (findAllUsedArgs sc topargs)
97
findUsedArgs sc topargs = nub (findAllUsedArgs sc topargs)
58
true
true
0
7
28
42
22
20
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F04.hs
bsd-3-clause
ptr_glCompressedTextureSubImage1DEXT :: FunPtr (GLuint -> GLenum -> GLint -> GLint -> GLsizei -> GLenum -> GLsizei -> Ptr a -> IO ()) ptr_glCompressedTextureSubImage1DEXT = unsafePerformIO $ getCommand "glCompressedTextureSubImage1DEXT"
236
ptr_glCompressedTextureSubImage1DEXT :: FunPtr (GLuint -> GLenum -> GLint -> GLint -> GLsizei -> GLenum -> GLsizei -> Ptr a -> IO ()) ptr_glCompressedTextureSubImage1DEXT = unsafePerformIO $ getCommand "glCompressedTextureSubImage1DEXT"
236
ptr_glCompressedTextureSubImage1DEXT = unsafePerformIO $ getCommand "glCompressedTextureSubImage1DEXT"
102
false
true
0
16
27
64
31
33
null
null
AubreyEAnderson/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkSpuriousExec3 = verifyNot checkSpuriousExec "echo cow; exec foo"
74
prop_checkSpuriousExec3 = verifyNot checkSpuriousExec "echo cow; exec foo"
74
prop_checkSpuriousExec3 = verifyNot checkSpuriousExec "echo cow; exec foo"
74
false
false
0
5
7
11
5
6
null
null
svenssonjoel/ObsidianGFX
Obsidian/Library.hs
bsd-3-clause
--------------------------------------------------------------------------- -- pair --------------------------------------------------------------------------- -- | Pair up consecutive elements in a Pull array. pair :: ASize l => Pull l a -> Pull l (a,a) pair arr = mkPull n' (\ix -> (arr ! (ix*2),arr ! (ix*2+1))) ...
393
pair :: ASize l => Pull l a -> Pull l (a,a) pair arr = mkPull n' (\ix -> (arr ! (ix*2),arr ! (ix*2+1))) where n' = len arr `div` 2 -- | Flatten a Pull array of pairs.
181
pair arr = mkPull n' (\ix -> (arr ! (ix*2),arr ! (ix*2+1))) where n' = len arr `div` 2 -- | Flatten a Pull array of pairs.
137
true
true
0
12
68
108
59
49
null
null
bsummer4/gcal
src/Auth.hs
agpl-3.0
fmtAuthParams ∷ AuthParams → [(Text,Maybe Text)] fmtAuthParams params = second Just <$> catMaybes results where results ∷ [Maybe(Text,Text)] = [ ("response_type",) <$> Just "code" , ("client_id",) <$> Just (params ^. clientID . clientIDText) , ("redirect_uri",) <$> Just (T.decodeUtf8 $ params ...
1,013
fmtAuthParams ∷ AuthParams → [(Text,Maybe Text)] fmtAuthParams params = second Just <$> catMaybes results where results ∷ [Maybe(Text,Text)] = [ ("response_type",) <$> Just "code" , ("client_id",) <$> Just (params ^. clientID . clientIDText) , ("redirect_uri",) <$> Just (T.decodeUtf8 $ params ...
1,013
fmtAuthParams params = second Just <$> catMaybes results where results ∷ [Maybe(Text,Text)] = [ ("response_type",) <$> Just "code" , ("client_id",) <$> Just (params ^. clientID . clientIDText) , ("redirect_uri",) <$> Just (T.decodeUtf8 $ params ^. redirectURI . uriBS) , ("scope",) <$> J...
964
false
true
1
13
326
316
172
144
null
null
andir/ganeti
src/Ganeti/HTools/Program/Hspace.hs
bsd-2-clause
-- | 'RSpec' formatting information including spindles. specDataSpn :: [(String, RSpec -> String)] specDataSpn = specData ++ [("SPN", printf "%d" . rspecSpn)]
158
specDataSpn :: [(String, RSpec -> String)] specDataSpn = specData ++ [("SPN", printf "%d" . rspecSpn)]
102
specDataSpn = specData ++ [("SPN", printf "%d" . rspecSpn)]
59
true
true
0
10
21
52
27
25
null
null
luigy/stack
src/Stack/SDist.hs
bsd-3-clause
normalizePath :: FilePath -> Maybe FilePath normalizePath = fmap FP.joinPath . go . FP.splitDirectories . FP.normalise where go [] = Just [] go ("..":_) = Nothing go (_:"..":xs) = go xs go (x:xs) = (x :) <$> go xs
231
normalizePath :: FilePath -> Maybe FilePath normalizePath = fmap FP.joinPath . go . FP.splitDirectories . FP.normalise where go [] = Just [] go ("..":_) = Nothing go (_:"..":xs) = go xs go (x:xs) = (x :) <$> go xs
231
normalizePath = fmap FP.joinPath . go . FP.splitDirectories . FP.normalise where go [] = Just [] go ("..":_) = Nothing go (_:"..":xs) = go xs go (x:xs) = (x :) <$> go xs
187
false
true
0
9
56
120
60
60
null
null
peterokagey/haskellOEIS
src/Poset/A334111.hs
apache-2.0
takeUntil :: Ord a => a -> [a] -> [a] takeUntil _ [] = []
57
takeUntil :: Ord a => a -> [a] -> [a] takeUntil _ [] = []
57
takeUntil _ [] = []
19
false
true
0
8
14
41
21
20
null
null
dsalisbury/xmobar
src/Plugins/Monitors/MPD.hs
bsd-3-clause
defaultOpts :: MOpts defaultOpts = MOpts { mPlaying = ">>" , mStopped = "><" , mPaused = "||" , mLapsedIconPattern = Nothing }
136
defaultOpts :: MOpts defaultOpts = MOpts { mPlaying = ">>" , mStopped = "><" , mPaused = "||" , mLapsedIconPattern = Nothing }
136
defaultOpts = MOpts { mPlaying = ">>" , mStopped = "><" , mPaused = "||" , mLapsedIconPattern = Nothing }
115
false
true
0
7
32
41
24
17
null
null
jbedo/LinProg
Math/LinProg/Types.hs
bsd-3-clause
vars :: (Hashable v, Eq v) => LinExpr t v -> [v] vars = S.toList . cata vars' where vars' (Wvar _ x) = S.fromList [x] vars' (Var x) = S.fromList [x] vars' (Add a b) = S.union a b vars' (Mul a b) = S.union a b vars' (Negate a) = a vars' _ = S.empty -- | Expands terms to Wvars but does not collect like terms
320
vars :: (Hashable v, Eq v) => LinExpr t v -> [v] vars = S.toList . cata vars' where vars' (Wvar _ x) = S.fromList [x] vars' (Var x) = S.fromList [x] vars' (Add a b) = S.union a b vars' (Mul a b) = S.union a b vars' (Negate a) = a vars' _ = S.empty -- | Expands terms to Wvars but does not collect like terms
320
vars = S.toList . cata vars' where vars' (Wvar _ x) = S.fromList [x] vars' (Var x) = S.fromList [x] vars' (Add a b) = S.union a b vars' (Mul a b) = S.union a b vars' (Negate a) = a vars' _ = S.empty -- | Expands terms to Wvars but does not collect like terms
271
false
true
1
9
81
181
84
97
null
null
evanrinehart/broccoli
Control/Broccoli/Eval.hs
bsd-3-clause
-- experiments w t = 10 - t/2
29
w t = 10 - t/2
14
w t = 10 - t/2
14
true
false
0
6
7
18
9
9
null
null
holzensp/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
translateOp dflags IntNegOp = Just (mo_wordSNeg dflags)
62
translateOp dflags IntNegOp = Just (mo_wordSNeg dflags)
62
translateOp dflags IntNegOp = Just (mo_wordSNeg dflags)
62
false
false
0
7
13
20
9
11
null
null
jmct/IterativeCompiler
frontend/Language.hs
mit
pprAlters (x:xs) = (pprAlter x) `IAppend` INewline `IAppend` (pprAlters xs)
104
pprAlters (x:xs) = (pprAlter x) `IAppend` INewline `IAppend` (pprAlters xs)
104
pprAlters (x:xs) = (pprAlter x) `IAppend` INewline `IAppend` (pprAlters xs)
104
false
false
0
8
38
40
22
18
null
null
flocc-net/flocc
v0.1/Compiler/Types2/TypeAssignment.hs
apache-2.0
showTyScheme (Scheme vars term) = "forall " ++ (delimList "," $ map (\i -> ("v" ++ show i)) vars) ++ " => " ++ (showTyTerm term)
133
showTyScheme (Scheme vars term) = "forall " ++ (delimList "," $ map (\i -> ("v" ++ show i)) vars) ++ " => " ++ (showTyTerm term)
133
showTyScheme (Scheme vars term) = "forall " ++ (delimList "," $ map (\i -> ("v" ++ show i)) vars) ++ " => " ++ (showTyTerm term)
133
false
false
0
15
30
68
34
34
null
null
swift-nav/libsbp
haskell/src/SwiftNav/SBP/Piksi.hs
lgpl-3.0
msgCwStart :: Word16 msgCwStart = 0x00C1
40
msgCwStart :: Word16 msgCwStart = 0x00C1
40
msgCwStart = 0x00C1
19
false
true
0
4
5
11
6
5
null
null
dolio/vector
Data/Vector/Generic.hs
bsd-3-clause
unsafeAccumulate_ f v is xs = unsafeAccum_stream f v (Bundle.zipWith (,) (stream is) (stream xs))
99
unsafeAccumulate_ f v is xs = unsafeAccum_stream f v (Bundle.zipWith (,) (stream is) (stream xs))
99
unsafeAccumulate_ f v is xs = unsafeAccum_stream f v (Bundle.zipWith (,) (stream is) (stream xs))
99
false
false
0
9
16
49
24
25
null
null
kovach/web2
src/Types.hs
mit
tfact :: Tuple -> Fact tfact t = (label t, nodes t)
51
tfact :: Tuple -> Fact tfact t = (label t, nodes t)
51
tfact t = (label t, nodes t)
28
false
true
0
7
11
36
16
20
null
null
beni55/haste-compiler
libraries/haste-lib/src/Haste/Concurrent/Monad.hs
bsd-3-clause
-- | Create a new empty MVar. newEmptyMVar :: MonadIO m => m (MVar a) newEmptyMVar = liftIO $ MVar `fmap` newIORef (Empty [])
125
newEmptyMVar :: MonadIO m => m (MVar a) newEmptyMVar = liftIO $ MVar `fmap` newIORef (Empty [])
95
newEmptyMVar = liftIO $ MVar `fmap` newIORef (Empty [])
55
true
true
0
9
23
49
25
24
null
null
yesodweb/persistent
persistent/Database/Persist/Sql/Class.hs
mit
-- | @since 2.11.0 to53 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),a3) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2...
680
to53 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),a3) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,...
661
to53 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),a3) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y...
328
true
true
1
6
12
815
538
277
null
null
inct-www-club/Procon2014
src/visualize.hs
mit
printAns ident ans = do putStrLn "******************" let str = answerStr ans putStrLn str case ident of Just s -> sendContent s str Nothing -> return ()
175
printAns ident ans = do putStrLn "******************" let str = answerStr ans putStrLn str case ident of Just s -> sendContent s str Nothing -> return ()
175
printAns ident ans = do putStrLn "******************" let str = answerStr ans putStrLn str case ident of Just s -> sendContent s str Nothing -> return ()
175
false
false
1
12
48
72
28
44
null
null
wavewave/lhc-analysis-collection
exe/evchainRunXQLD_2sg.hs
gpl-3.0
worksets = [ (mgl,msq,50000,50000, 10000) | mgl <- [700], msq <- [100,200,300,400] ]
84
worksets = [ (mgl,msq,50000,50000, 10000) | mgl <- [700], msq <- [100,200,300,400] ]
84
worksets = [ (mgl,msq,50000,50000, 10000) | mgl <- [700], msq <- [100,200,300,400] ]
84
false
false
0
8
12
55
33
22
null
null
oldmanmike/ghc
compiler/types/Coercion.hs
bsd-3-clause
setCoVarUnique :: CoVar -> Unique -> CoVar setCoVarUnique = setVarUnique
72
setCoVarUnique :: CoVar -> Unique -> CoVar setCoVarUnique = setVarUnique
72
setCoVarUnique = setVarUnique
29
false
true
0
6
9
19
10
9
null
null
zalora/journal-mailer
src/Process.hs
bsd-3-clause
-- | combines RESULT and MESSAGE (if they exist) outcome :: JournalFields -> Text outcome fields = cs $ case (lookup "RESULT" fields, lookup "MESSAGE" fields) of (Just result, Just message) -> ": " <> result <> ": " <> message (Just result, Nothing) -> ": " <> result (Nothing, Just message) -> ": " <> message (...
343
outcome :: JournalFields -> Text outcome fields = cs $ case (lookup "RESULT" fields, lookup "MESSAGE" fields) of (Just result, Just message) -> ": " <> result <> ": " <> message (Just result, Nothing) -> ": " <> result (Nothing, Just message) -> ": " <> message (Nothing, Nothing) -> ""
294
outcome fields = cs $ case (lookup "RESULT" fields, lookup "MESSAGE" fields) of (Just result, Just message) -> ": " <> result <> ": " <> message (Just result, Nothing) -> ": " <> result (Nothing, Just message) -> ": " <> message (Nothing, Nothing) -> ""
261
true
true
2
10
68
130
65
65
null
null
sqd/haskell-C89-interpreter
Utils.hs
mit
-- Similiar to `span`, but put the first unqualified element in the fst position -- eg. span (/=';') "abc;efg" = ("abc", ";efg") -- eg. span' (/=';') "abc;efg" = ("abc;", "efg") span' :: (a -> Bool) -> [a] -> ([a], [a]) span' f [] = ([], [])
241
span' :: (a -> Bool) -> [a] -> ([a], [a]) span' f [] = ([], [])
63
span' f [] = ([], [])
21
true
true
0
8
45
61
36
25
null
null
zeyuanxy/haskell-playground
write-yourself-a-scheme/chap8/main.hs
mit
showError (NotFunction message func) = message ++ ": " ++ show func
67
showError (NotFunction message func) = message ++ ": " ++ show func
67
showError (NotFunction message func) = message ++ ": " ++ show func
67
false
false
0
7
11
28
13
15
null
null
chwarr/bond
compiler/Options.hs
mit
slashNormalizeOption o@Java{..} = o { files = map slashNormalize files, import_dir = map slashNormalize import_dir, output_dir = slashNormalize output_dir }
238
slashNormalizeOption o@Java{..} = o { files = map slashNormalize files, import_dir = map slashNormalize import_dir, output_dir = slashNormalize output_dir }
238
slashNormalizeOption o@Java{..} = o { files = map slashNormalize files, import_dir = map slashNormalize import_dir, output_dir = slashNormalize output_dir }
238
false
false
0
8
101
51
27
24
null
null
sdiehl/ghc
libraries/ghc-prim/Setup.hs
bsd-3-clause
ddPrimModuleForHaddock :: Hook a -> Hook a addPrimModuleForHaddock f pd lbi uhs x = do let pc = withPrograms lbi pc' = userSpecifyArgs "haddock" ["GHC/Prim.hs"] pc lbi' = lbi { withPrograms = pc' } f pd lbi' uhs x
247
addPrimModuleForHaddock :: Hook a -> Hook a addPrimModuleForHaddock f pd lbi uhs x = do let pc = withPrograms lbi pc' = userSpecifyArgs "haddock" ["GHC/Prim.hs"] pc lbi' = lbi { withPrograms = pc' } f pd lbi' uhs x
247
addPrimModuleForHaddock f pd lbi uhs x = do let pc = withPrograms lbi pc' = userSpecifyArgs "haddock" ["GHC/Prim.hs"] pc lbi' = lbi { withPrograms = pc' } f pd lbi' uhs x
203
false
true
0
11
72
84
41
43
null
null
brendanhay/gogol
gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs
mpl-2.0
-- | This is always *sql#backupRunsList*. brlrKind :: Lens' BackupRunsListResponse (Maybe Text) brlrKind = lens _brlrKind (\ s a -> s{_brlrKind = a})
149
brlrKind :: Lens' BackupRunsListResponse (Maybe Text) brlrKind = lens _brlrKind (\ s a -> s{_brlrKind = a})
107
brlrKind = lens _brlrKind (\ s a -> s{_brlrKind = a})
53
true
true
1
9
22
49
25
24
null
null
ekmett/ghc
compiler/main/DriverPhases.hs
bsd-3-clause
startPhase "cc" = Ccpp
28
startPhase "cc" = Ccpp
28
startPhase "cc" = Ccpp
28
false
false
0
4
9
10
4
6
null
null
diagrams/diagrams-contrib
src/Diagrams/Color/XKCD.hs
bsd-3-clause
warmGrey = fromJust $ readHexColor "#978a84"
57
warmGrey = fromJust $ readHexColor "#978a84"
57
warmGrey = fromJust $ readHexColor "#978a84"
57
false
false
0
6
18
13
6
7
null
null
agremm/Seismic
accelerate/cpu_up/Seismic.hs
gpl-3.0
genAPF 0 _ = undefined
22
genAPF 0 _ = undefined
22
genAPF 0 _ = undefined
22
false
false
0
5
4
11
5
6
null
null
GregorySchwartz/scan
src/BMatrix.hs
gpl-3.0
-- | Get the B2 matrix from the B1 matrix, using the qGram length to figure -- out a mapping of the column ints getB2:: B1 -> B2 getB2 (B1 b1) = B2 . IMap.map (IMap.mapWithKey norm) $ b1 where norm k v = normFactor k * v normFactor k = logBase 2 ( fromIntegral (IMap.size b1) ...
491
getB2:: B1 -> B2 getB2 (B1 b1) = B2 . IMap.map (IMap.mapWithKey norm) $ b1 where norm k v = normFactor k * v normFactor k = logBase 2 ( fromIntegral (IMap.size b1) / mLookup "getB2 mLookup" qGramCounts k ) qGramCounts = IMap.map ma...
379
getB2 (B1 b1) = B2 . IMap.map (IMap.mapWithKey norm) $ b1 where norm k v = normFactor k * v normFactor k = logBase 2 ( fromIntegral (IMap.size b1) / mLookup "getB2 mLookup" qGramCounts k ) qGramCounts = IMap.map mapSum . transpose ...
362
true
true
2
14
170
123
61
62
null
null