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
li-zhirui/EoplLangs
src/MutablePairs/Parser.hs
bsd-3-clause
-- | Expression ::= ConstExpr -- ::= BinOpExpr -- ::= UnaryOpExpr -- ::= IfExpr -- ::= CondExpr -- ::= VarExpr -- ::= LetExpr -- ::= ProcExpr -- ::= CallExpr -- ::= LetRecExpr -- ::= BeginExpr -- ::= AssignExpr -- ::= SetDynamicExpr -- ::= NewPairExpr -- ::= GetLeftExpr -- ::= GetRightExpr -- ::= SetLeftExpr -- ::= SetRightExpr expression :: Parser Expression expression = foldl1 (<|>) (fmap try expressionList) where expressionList = [ constExpr , binOpExpr , unaryOpExpr , ifExpr , condExpr , varExpr , letExpr , procExpr , callExpr , letRecExpr , beginExpr , assignExpr , setDynamicExpr , newPairExpr , getLeftExpr , getRightExpr , setLeftExpr , setRightExpr ]
1,006
expression :: Parser Expression expression = foldl1 (<|>) (fmap try expressionList) where expressionList = [ constExpr , binOpExpr , unaryOpExpr , ifExpr , condExpr , varExpr , letExpr , procExpr , callExpr , letRecExpr , beginExpr , assignExpr , setDynamicExpr , newPairExpr , getLeftExpr , getRightExpr , setLeftExpr , setRightExpr ]
455
expression = foldl1 (<|>) (fmap try expressionList) where expressionList = [ constExpr , binOpExpr , unaryOpExpr , ifExpr , condExpr , varExpr , letExpr , procExpr , callExpr , letRecExpr , beginExpr , assignExpr , setDynamicExpr , newPairExpr , getLeftExpr , getRightExpr , setLeftExpr , setRightExpr ]
423
true
true
1
7
447
118
74
44
null
null
ekmett/ghc
compiler/nativeGen/PPC/Ppr.hs
bsd-3-clause
pprImm (HI i) = sdocWithPlatform $ \platform -> if platformOS platform == OSDarwin then hcat [ text "hi16(", pprImm i, rparen ] else pprImm i <> text "@h"
168
pprImm (HI i) = sdocWithPlatform $ \platform -> if platformOS platform == OSDarwin then hcat [ text "hi16(", pprImm i, rparen ] else pprImm i <> text "@h"
168
pprImm (HI i) = sdocWithPlatform $ \platform -> if platformOS platform == OSDarwin then hcat [ text "hi16(", pprImm i, rparen ] else pprImm i <> text "@h"
168
false
false
0
10
41
67
33
34
null
null
ingemaradahl/bilder
src/Compiler/Simple/Utils.hs
lgpl-3.0
mapStmExpM f (SFor fds ecs els s) = SFor <$> mapM (mapStmExpM f) fds <*> mapM f ecs <*> mapM f els <*> mapM (mapStmExpM f) s
126
mapStmExpM f (SFor fds ecs els s) = SFor <$> mapM (mapStmExpM f) fds <*> mapM f ecs <*> mapM f els <*> mapM (mapStmExpM f) s
126
mapStmExpM f (SFor fds ecs els s) = SFor <$> mapM (mapStmExpM f) fds <*> mapM f ecs <*> mapM f els <*> mapM (mapStmExpM f) s
126
false
false
0
11
28
71
33
38
null
null
ancientlanguage/haskell-analysis
prepare/src/Prepare/Decompose.hs
mit
decomposeChar '\x01E7' = "\x0067\x030C"
39
decomposeChar '\x01E7' = "\x0067\x030C"
39
decomposeChar '\x01E7' = "\x0067\x030C"
39
false
false
1
5
3
13
4
9
null
null
stevely/hspirv
src/SpirV/Builder/Raw.hs
bsd-3-clause
addSourceExt :: Text -> Module -> Module addSourceExt ext m = m { sourceExts = sourceExts m |> OpSourceExtension (encodeUtf8 ext) }
135
addSourceExt :: Text -> Module -> Module addSourceExt ext m = m { sourceExts = sourceExts m |> OpSourceExtension (encodeUtf8 ext) }
135
addSourceExt ext m = m { sourceExts = sourceExts m |> OpSourceExtension (encodeUtf8 ext) }
94
false
true
0
11
25
52
25
27
null
null
yyotti/euler_haskell
test/P001Spec.hs
mit
main :: IO () main = hspec spec
31
main :: IO () main = hspec spec
31
main = hspec spec
17
false
true
1
6
7
22
9
13
null
null
ml9951/ghc
compiler/main/DriverMkDepend.hs
bsd-3-clause
dumpModCycles :: DynFlags -> [ModSummary] -> IO () dumpModCycles dflags mod_summaries | not (dopt Opt_D_dump_mod_cycles dflags) = return () | null cycles = putMsg dflags (ptext (sLit "No module cycles")) | otherwise = putMsg dflags (hang (ptext (sLit "Module cycles found:")) 2 pp_cycles) where cycles :: [[ModSummary]] cycles = [ c | CyclicSCC c <- GHC.topSortModuleGraph True mod_summaries Nothing ] pp_cycles = vcat [ (ptext (sLit "---------- Cycle") <+> int n <+> ptext (sLit "----------")) $$ pprCycle c $$ blankLine | (n,c) <- [1..] `zip` cycles ]
628
dumpModCycles :: DynFlags -> [ModSummary] -> IO () dumpModCycles dflags mod_summaries | not (dopt Opt_D_dump_mod_cycles dflags) = return () | null cycles = putMsg dflags (ptext (sLit "No module cycles")) | otherwise = putMsg dflags (hang (ptext (sLit "Module cycles found:")) 2 pp_cycles) where cycles :: [[ModSummary]] cycles = [ c | CyclicSCC c <- GHC.topSortModuleGraph True mod_summaries Nothing ] pp_cycles = vcat [ (ptext (sLit "---------- Cycle") <+> int n <+> ptext (sLit "----------")) $$ pprCycle c $$ blankLine | (n,c) <- [1..] `zip` cycles ]
628
dumpModCycles dflags mod_summaries | not (dopt Opt_D_dump_mod_cycles dflags) = return () | null cycles = putMsg dflags (ptext (sLit "No module cycles")) | otherwise = putMsg dflags (hang (ptext (sLit "Module cycles found:")) 2 pp_cycles) where cycles :: [[ModSummary]] cycles = [ c | CyclicSCC c <- GHC.topSortModuleGraph True mod_summaries Nothing ] pp_cycles = vcat [ (ptext (sLit "---------- Cycle") <+> int n <+> ptext (sLit "----------")) $$ pprCycle c $$ blankLine | (n,c) <- [1..] `zip` cycles ]
577
false
true
1
14
161
238
118
120
null
null
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/ConsentStores/QueryAccessibleData.hs
mpl-2.0
-- | OAuth access token. pldscsqadAccessToken :: Lens' ProjectsLocationsDataSetsConsentStoresQueryAccessibleData (Maybe Text) pldscsqadAccessToken = lens _pldscsqadAccessToken (\ s a -> s{_pldscsqadAccessToken = a})
223
pldscsqadAccessToken :: Lens' ProjectsLocationsDataSetsConsentStoresQueryAccessibleData (Maybe Text) pldscsqadAccessToken = lens _pldscsqadAccessToken (\ s a -> s{_pldscsqadAccessToken = a})
198
pldscsqadAccessToken = lens _pldscsqadAccessToken (\ s a -> s{_pldscsqadAccessToken = a})
97
true
true
0
8
29
49
25
24
null
null
faylang/fay-server
src/Language/Fay/JQuery.hs
bsd-3-clause
parentsUntilFiltered :: String -> String -> JQuery -> Fay JQuery parentsUntilFiltered = ffi "%3['parentsUntil'](%1, %2)"
120
parentsUntilFiltered :: String -> String -> JQuery -> Fay JQuery parentsUntilFiltered = ffi "%3['parentsUntil'](%1, %2)"
120
parentsUntilFiltered = ffi "%3['parentsUntil'](%1, %2)"
55
false
true
0
8
14
29
14
15
null
null
paulp/unison
parser-typechecker/src/Unison/ABT.hs
mit
-- | `subst v e body` substitutes `e` for `v` in `body`, avoiding capture by -- renaming abstractions in `body` subst :: (Foldable f, Functor f, Var v) => v -> Term f v a -> Term f v a -> Term f v a subst v r t2 = subst' (const r) v (freeVars r) t2
248
subst :: (Foldable f, Functor f, Var v) => v -> Term f v a -> Term f v a -> Term f v a subst v r t2 = subst' (const r) v (freeVars r) t2
136
subst v r t2 = subst' (const r) v (freeVars r) t2
49
true
true
0
9
56
95
47
48
null
null
5outh/Elm
src/Type/State.hs
bsd-3-clause
needsCopy :: Content -> Bool needsCopy content = case content of Structure _ -> True Atom _ -> False Var _ _ _ -> True Alias _ _ _ -> True Error -> False
219
needsCopy :: Content -> Bool needsCopy content = case content of Structure _ -> True Atom _ -> False Var _ _ _ -> True Alias _ _ _ -> True Error -> False
219
needsCopy content = case content of Structure _ -> True Atom _ -> False Var _ _ _ -> True Alias _ _ _ -> True Error -> False
190
false
true
0
8
99
78
35
43
null
null
dbp/hs-stripe
src/Web/Stripe/Subscription.hs
bsd-3-clause
cancelSub :: MonadIO m => CustomerId -> Maybe SubAtPeriodEnd -> StripeT m Subscription cancelSub cid mspe = snd `liftM` query (subRq cid []) { sMethod = DELETE, sData = optionalArgs odata } where odata = [("at_period_end", showByteString . unSubAtPeriodEnd <$> mspe)] -- | Convenience function to create a 'StripeRequest' specific to -- subscription-related actions.
387
cancelSub :: MonadIO m => CustomerId -> Maybe SubAtPeriodEnd -> StripeT m Subscription cancelSub cid mspe = snd `liftM` query (subRq cid []) { sMethod = DELETE, sData = optionalArgs odata } where odata = [("at_period_end", showByteString . unSubAtPeriodEnd <$> mspe)] -- | Convenience function to create a 'StripeRequest' specific to -- subscription-related actions.
387
cancelSub cid mspe = snd `liftM` query (subRq cid []) { sMethod = DELETE, sData = optionalArgs odata } where odata = [("at_period_end", showByteString . unSubAtPeriodEnd <$> mspe)] -- | Convenience function to create a 'StripeRequest' specific to -- subscription-related actions.
290
false
true
0
10
74
101
54
47
null
null
matterhorn-chat/matterhorn
src/Matterhorn/FilePaths.hs
bsd-3-clause
lastRunStateFileName :: Text -> FilePath lastRunStateFileName teamId = "last_run_state_" ++ unpack teamId ++ ".json"
116
lastRunStateFileName :: Text -> FilePath lastRunStateFileName teamId = "last_run_state_" ++ unpack teamId ++ ".json"
116
lastRunStateFileName teamId = "last_run_state_" ++ unpack teamId ++ ".json"
75
false
true
0
7
13
29
14
15
null
null
jonathankochems/hi
src/Hi.hs
bsd-3-clause
writeFiles :: Files -> IO () writeFiles = mapM_ write
53
writeFiles :: Files -> IO () writeFiles = mapM_ write
53
writeFiles = mapM_ write
24
false
true
0
7
9
23
11
12
null
null
zmthy/http-media
src/Network/HTTP/Media/MediaType.hs
mit
------------------------------------------------------------------------------ -- | Ensures the predicate matches for every character in the given string. ensure :: (Char -> Bool) -> ByteString -> ByteString ensure f bs = maybe (error $ "Invalid character in " ++ show bs) (const bs) (BS.find f bs)
302
ensure :: (Char -> Bool) -> ByteString -> ByteString ensure f bs = maybe (error $ "Invalid character in " ++ show bs) (const bs) (BS.find f bs)
147
ensure f bs = maybe (error $ "Invalid character in " ++ show bs) (const bs) (BS.find f bs)
94
true
true
0
8
45
75
37
38
null
null
jackbowman/basilica
Database/Users.hs
mit
invalidateCode :: Connection -> CodeRecord -> IO () invalidateCode conn CodeRecord{codeValue} = do rowCount <- run conn query args assert (rowCount == 1) return () where query = "update codes set valid = 0 where code = ?" args = [toSql codeValue]
260
invalidateCode :: Connection -> CodeRecord -> IO () invalidateCode conn CodeRecord{codeValue} = do rowCount <- run conn query args assert (rowCount == 1) return () where query = "update codes set valid = 0 where code = ?" args = [toSql codeValue]
260
invalidateCode conn CodeRecord{codeValue} = do rowCount <- run conn query args assert (rowCount == 1) return () where query = "update codes set valid = 0 where code = ?" args = [toSql codeValue]
208
false
true
2
9
55
94
42
52
null
null
rwtodd/small_programs
i_ching/haskell/iching.hs
gpl-2.0
clear_line = putStr "\ESC[K"
28
clear_line = putStr "\ESC[K"
28
clear_line = putStr "\ESC[K"
28
false
false
0
5
3
9
4
5
null
null
rwbarton/rw
Crawl/FloorItems.hs
bsd-3-clause
possiblyAny :: (item -> Bool) -> SquareItems item -> Bool possiblyAny _ Empty = False
85
possiblyAny :: (item -> Bool) -> SquareItems item -> Bool possiblyAny _ Empty = False
85
possiblyAny _ Empty = False
27
false
true
0
8
14
40
18
22
null
null
nevrenato/HetsAlloy
Common/Lexer.hs
gpl-2.0
-- * chars for quoted chars and literal strings printable :: CharParser st String printable = single $ satisfy $ \ c -> notElem c "'\"\\" && c > '\026'
152
printable :: CharParser st String printable = single $ satisfy $ \ c -> notElem c "'\"\\" && c > '\026'
103
printable = single $ satisfy $ \ c -> notElem c "'\"\\" && c > '\026'
69
true
true
4
8
30
51
23
28
null
null
rueshyna/gogol
gogol-classroom/gen/Network/Google/Resource/Classroom/Courses/Update.hs
mpl-2.0
-- | OAuth access token. cuAccessToken :: Lens' CoursesUpdate (Maybe Text) cuAccessToken = lens _cuAccessToken (\ s a -> s{_cuAccessToken = a})
151
cuAccessToken :: Lens' CoursesUpdate (Maybe Text) cuAccessToken = lens _cuAccessToken (\ s a -> s{_cuAccessToken = a})
126
cuAccessToken = lens _cuAccessToken (\ s a -> s{_cuAccessToken = a})
76
true
true
0
8
29
49
25
24
null
null
kazu-yamamoto/gitcab
Handler/File.hs
bsd-2-clause
noSuchFile :: Path -> Widget noSuchFile path = [whamlet| #{path}: no such file or directory |]
95
noSuchFile :: Path -> Widget noSuchFile path = [whamlet| #{path}: no such file or directory |]
95
noSuchFile path = [whamlet| #{path}: no such file or directory |]
66
false
true
0
5
16
22
13
9
null
null
athanclark/lh-bug
deps/unordered-containers/Data/HashMap/Array.hs
bsd-3-clause
marray mary _n = MArray mary
28
marray mary _n = MArray mary
28
marray mary _n = MArray mary
28
false
false
1
5
5
19
6
13
null
null
bitemyapp/ganeti
src/Ganeti/Runtime.hs
bsd-2-clause
daemonName GanetiConfd = "ganeti-confd"
41
daemonName GanetiConfd = "ganeti-confd"
41
daemonName GanetiConfd = "ganeti-confd"
41
false
false
0
5
5
9
4
5
null
null
mattgreen/hython
src/Hython/Class.hs
gpl-3.0
isSubClass :: ClassInfo -> ClassInfo -> Bool isSubClass derived base = base `elem` basesOf derived
98
isSubClass :: ClassInfo -> ClassInfo -> Bool isSubClass derived base = base `elem` basesOf derived
98
isSubClass derived base = base `elem` basesOf derived
53
false
true
0
8
14
38
18
20
null
null
da-x/buildsome-tst
app/Buildsome/BuildMaps.hs
bsd-3-clause
find :: BuildMaps -> FilePath -> Maybe (TargetKind, TargetDesc) find (BuildMaps buildMap childrenMap) path = -- Allow specific/simple matches to override pattern matches ((,) TargetSimple <$> simpleMatch) `mplus` ((,) TargetPattern <$> patternMatch) where simpleMatch = path `M.lookup` buildMap patterns = dbmPatterns $ M.findWithDefault mempty (takeDirectory path) childrenMap instantiate pattern = (,) pattern <$> Makefile.instantiatePatternByOutput path pattern patternMatch = case mapMaybe instantiate patterns of [] -> Nothing [(_, target)] -> Just $ descOfTarget target targets -> error $ BS8.unpack $ mconcat [ "Multiple matching patterns for: ", BS8.pack (show path), "\n" , BS8.unlines $ map (showPattern . fst) targets ] showPattern pattern = Print.posText (targetPos pattern) <> showPatternOutputs pattern showPatternOutputs pattern = BS8.unwords $ map (StringPattern.toString . Makefile.filePatternFile) $ targetOutputs pattern
1,061
find :: BuildMaps -> FilePath -> Maybe (TargetKind, TargetDesc) find (BuildMaps buildMap childrenMap) path = -- Allow specific/simple matches to override pattern matches ((,) TargetSimple <$> simpleMatch) `mplus` ((,) TargetPattern <$> patternMatch) where simpleMatch = path `M.lookup` buildMap patterns = dbmPatterns $ M.findWithDefault mempty (takeDirectory path) childrenMap instantiate pattern = (,) pattern <$> Makefile.instantiatePatternByOutput path pattern patternMatch = case mapMaybe instantiate patterns of [] -> Nothing [(_, target)] -> Just $ descOfTarget target targets -> error $ BS8.unpack $ mconcat [ "Multiple matching patterns for: ", BS8.pack (show path), "\n" , BS8.unlines $ map (showPattern . fst) targets ] showPattern pattern = Print.posText (targetPos pattern) <> showPatternOutputs pattern showPatternOutputs pattern = BS8.unwords $ map (StringPattern.toString . Makefile.filePatternFile) $ targetOutputs pattern
1,061
find (BuildMaps buildMap childrenMap) path = -- Allow specific/simple matches to override pattern matches ((,) TargetSimple <$> simpleMatch) `mplus` ((,) TargetPattern <$> patternMatch) where simpleMatch = path `M.lookup` buildMap patterns = dbmPatterns $ M.findWithDefault mempty (takeDirectory path) childrenMap instantiate pattern = (,) pattern <$> Makefile.instantiatePatternByOutput path pattern patternMatch = case mapMaybe instantiate patterns of [] -> Nothing [(_, target)] -> Just $ descOfTarget target targets -> error $ BS8.unpack $ mconcat [ "Multiple matching patterns for: ", BS8.pack (show path), "\n" , BS8.unlines $ map (showPattern . fst) targets ] showPattern pattern = Print.posText (targetPos pattern) <> showPatternOutputs pattern showPatternOutputs pattern = BS8.unwords $ map (StringPattern.toString . Makefile.filePatternFile) $ targetOutputs pattern
997
false
true
5
20
241
308
157
151
null
null
vikraman/ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
pprTickCts (UnfoldingDone v) = ppr v
47
pprTickCts (UnfoldingDone v) = ppr v
47
pprTickCts (UnfoldingDone v) = ppr v
47
false
false
0
7
16
18
8
10
null
null
brendanhay/gogol
gogol-serviceusage/gen/Network/Google/ServiceUsage/Types/Product.hs
mpl-2.0
-- | Service identity that service producer can use to access consumer -- resources. If exists is true, it contains email and unique_id. If exists -- is false, it contains pre-constructed email and empty unique_id. gsirIdentity :: Lens' GetServiceIdentityResponse (Maybe ServiceIdentity) gsirIdentity = lens _gsirIdentity (\ s a -> s{_gsirIdentity = a})
355
gsirIdentity :: Lens' GetServiceIdentityResponse (Maybe ServiceIdentity) gsirIdentity = lens _gsirIdentity (\ s a -> s{_gsirIdentity = a})
140
gsirIdentity = lens _gsirIdentity (\ s a -> s{_gsirIdentity = a})
67
true
true
0
9
53
50
27
23
null
null
ndmitchell/qed
src/Proof/QED.hs
bsd-3-clause
expand :: Proof () expand = apply rewriteEquivalent $ \Known{..} o@(fromLams -> (vs, x)) -> Just $ let v:_ = fresh $ vars o in lams (vs ++ [v]) $ App x $ Var v
168
expand :: Proof () expand = apply rewriteEquivalent $ \Known{..} o@(fromLams -> (vs, x)) -> Just $ let v:_ = fresh $ vars o in lams (vs ++ [v]) $ App x $ Var v
168
expand = apply rewriteEquivalent $ \Known{..} o@(fromLams -> (vs, x)) -> Just $ let v:_ = fresh $ vars o in lams (vs ++ [v]) $ App x $ Var v
149
false
true
1
15
43
109
53
56
null
null
fmapfmapfmap/amazonka
amazonka-ds/test/Main.hs
mpl-2.0
main :: IO () main = defaultMain $ testGroup "DirectoryService" [ testGroup "tests" tests , testGroup "fixtures" fixtures ]
138
main :: IO () main = defaultMain $ testGroup "DirectoryService" [ testGroup "tests" tests , testGroup "fixtures" fixtures ]
138
main = defaultMain $ testGroup "DirectoryService" [ testGroup "tests" tests , testGroup "fixtures" fixtures ]
124
false
true
2
7
33
49
21
28
null
null
sinjar666/fbthrift
thrift/compiler/test/fixtures/service-fuzzer/gen-hs/TestService_Fuzzer.hs
apache-2.0
fuzzerFunctions :: [(String, (Options -> IO ()))] fuzzerFunctions = [("init", init_fuzzer)]
91
fuzzerFunctions :: [(String, (Options -> IO ()))] fuzzerFunctions = [("init", init_fuzzer)]
91
fuzzerFunctions = [("init", init_fuzzer)]
41
false
true
0
10
10
41
24
17
null
null
vladimir-ipatov/ganeti
src/Ganeti/Constants.hs
gpl-2.0
jqtStartmsg :: String jqtStartmsg = "startmsg"
46
jqtStartmsg :: String jqtStartmsg = "startmsg"
46
jqtStartmsg = "startmsg"
24
false
true
0
6
5
18
7
11
null
null
siddhanathan/ghc
libraries/base/GHC/Show.hs
bsd-3-clause
-- Precedence of application: -- one more than the maximum operator precedence of 9 appPrec1 = I# 11#
127
appPrec1 = I# 11#
17
appPrec1 = I# 11#
17
true
false
1
5
43
14
6
8
null
null
nevrenato/Hets_Fork
CASL/Sign.hs
gpl-2.0
closeSubsortRel :: State.State (Sign f e) () closeSubsortRel = do e <- State.get State.put e { sortRel = Rel.transClosure $ sortRel e }
146
closeSubsortRel :: State.State (Sign f e) () closeSubsortRel = do e <- State.get State.put e { sortRel = Rel.transClosure $ sortRel e }
146
closeSubsortRel = do e <- State.get State.put e { sortRel = Rel.transClosure $ sortRel e }
101
false
true
0
11
33
62
30
32
null
null
buildsome/buildsome
src/Buildsome/Chart.hs
gpl-2.0
buildTimes :: Stats -> Chart.PieChart buildTimes stats = def { Chart._pie_data = dataPoints } where dataPoints = let f (targetRep, targetStats) = def { Chart._pitem_label = BS8.unpack $ BuildMaps.targetRepPath targetRep , Chart._pitem_value = realToFrac (Stats.tsTime targetStats) } in map f $ M.toList $ Stats.ofTarget stats
361
buildTimes :: Stats -> Chart.PieChart buildTimes stats = def { Chart._pie_data = dataPoints } where dataPoints = let f (targetRep, targetStats) = def { Chart._pitem_label = BS8.unpack $ BuildMaps.targetRepPath targetRep , Chart._pitem_value = realToFrac (Stats.tsTime targetStats) } in map f $ M.toList $ Stats.ofTarget stats
361
buildTimes stats = def { Chart._pie_data = dataPoints } where dataPoints = let f (targetRep, targetStats) = def { Chart._pitem_label = BS8.unpack $ BuildMaps.targetRepPath targetRep , Chart._pitem_value = realToFrac (Stats.tsTime targetStats) } in map f $ M.toList $ Stats.ofTarget stats
323
false
true
0
14
80
116
59
57
null
null
amplify-education/filestore
Data/FileStore/Git.hs
bsd-3-clause
pushRemote :: FilePath -> Remote -> IO () pushRemote repo remote = do (status, err, _) <- runGitCommand repo "push" [remoteName remote, remoteBranch remote] if status == ExitSuccess then return () else throwIO $ UnknownError $ "git push failed with error " ++ err
285
pushRemote :: FilePath -> Remote -> IO () pushRemote repo remote = do (status, err, _) <- runGitCommand repo "push" [remoteName remote, remoteBranch remote] if status == ExitSuccess then return () else throwIO $ UnknownError $ "git push failed with error " ++ err
285
pushRemote repo remote = do (status, err, _) <- runGitCommand repo "push" [remoteName remote, remoteBranch remote] if status == ExitSuccess then return () else throwIO $ UnknownError $ "git push failed with error " ++ err
243
false
true
0
10
65
101
49
52
null
null
nevrenato/HetsAlloy
VSE/Prove.hs
gpl-2.0
sigP :: String sigP = "SIG"
27
sigP :: String sigP = "SIG"
27
sigP = "SIG"
12
false
true
0
4
5
11
6
5
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGFESpotLightElement.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGFESpotLightElement.limitingConeAngle Mozilla SVGFESpotLightElement.limitingConeAngle documentation> getLimitingConeAngle :: (MonadDOM m) => SVGFESpotLightElement -> m SVGAnimatedNumber getLimitingConeAngle self = liftDOM ((self ^. js "limitingConeAngle") >>= fromJSValUnchecked)
360
getLimitingConeAngle :: (MonadDOM m) => SVGFESpotLightElement -> m SVGAnimatedNumber getLimitingConeAngle self = liftDOM ((self ^. js "limitingConeAngle") >>= fromJSValUnchecked)
201
getLimitingConeAngle self = liftDOM ((self ^. js "limitingConeAngle") >>= fromJSValUnchecked)
95
true
true
0
10
48
56
27
29
null
null
futtetennista/IntroductionToFunctionalProgramming
src/AsyncPlayground.hs
mit
action2 :: IO String action2 = handle onErr $ do threadDelay 500000 return "action2 completed" where onErr e = do putStrLn $ "action2 was killed by: " ++ displayException e throwIO (e :: SomeException)
229
action2 :: IO String action2 = handle onErr $ do threadDelay 500000 return "action2 completed" where onErr e = do putStrLn $ "action2 was killed by: " ++ displayException e throwIO (e :: SomeException)
229
action2 = handle onErr $ do threadDelay 500000 return "action2 completed" where onErr e = do putStrLn $ "action2 was killed by: " ++ displayException e throwIO (e :: SomeException)
208
false
true
2
9
61
77
31
46
null
null
ziman/idris-ocaml
src/Util/PrettyPrint.hs
bsd-3-clause
lbrace = text "{"
19
lbrace = text "{"
19
lbrace = text "{"
19
false
false
1
5
5
13
4
9
null
null
gspindles/mj-score-eval
src/Game/Mahjong/Static/Melds.hs
mit
k666 = fromJust $ mkMeld Revealed Triplet [k6, k6, k6]
54
k666 = fromJust $ mkMeld Revealed Triplet [k6, k6, k6]
54
k666 = fromJust $ mkMeld Revealed Triplet [k6, k6, k6]
54
false
false
1
7
9
29
14
15
null
null
mzini/qlogic
Qlogic/SatSolverHash.hs
gpl-3.0
addNegatively' (p,n) fm@(Or as) = do nlits <- mapM (\l -> addNegatively l >>= negateELit) as mapM_ (\l -> addLitClause $ Clause [p, l]) nlits return p
163
addNegatively' (p,n) fm@(Or as) = do nlits <- mapM (\l -> addNegatively l >>= negateELit) as mapM_ (\l -> addLitClause $ Clause [p, l]) nlits return p
163
addNegatively' (p,n) fm@(Or as) = do nlits <- mapM (\l -> addNegatively l >>= negateELit) as mapM_ (\l -> addLitClause $ Clause [p, l]) nlits return p
163
false
false
0
12
39
88
44
44
null
null
thomaslecointre/Distributed-Haskell
slave/GetWordsFile.hs
mit
isStopWord :: T.Text -- ^ A word -> Bool -- ^ Is or not a stopword isStopWord w = S.member w stopWords
121
isStopWord :: T.Text -- ^ A word -> Bool isStopWord w = S.member w stopWords
91
isStopWord w = S.member w stopWords
35
true
true
0
6
40
29
15
14
null
null
taojang/haskell-programming-book-exercise
src/ch12/Live.hs
bsd-3-clause
mayybee :: b -> (a -> b) -> Maybe a -> b mayybee x f y = case f <$> y of Nothing -> x Just z -> z
134
mayybee :: b -> (a -> b) -> Maybe a -> b mayybee x f y = case f <$> y of Nothing -> x Just z -> z
134
mayybee x f y = case f <$> y of Nothing -> x Just z -> z
93
false
true
0
8
65
63
31
32
null
null
BartAdv/Idris-dev
src/Idris/REPLParser.hs
bsd-3-clause
cmd_dynamic :: String -> P.IdrisParser (Either String Command) cmd_dynamic name = do let emptyArgs = noArgs ListDynamic name let oneArg = do l <- many anyChar return $ Right (DynamicLink l) let failure = return $ Left $ "Usage is :" ++ name ++ " [<library>]" try emptyArgs <|> try oneArg <|> failure
338
cmd_dynamic :: String -> P.IdrisParser (Either String Command) cmd_dynamic name = do let emptyArgs = noArgs ListDynamic name let oneArg = do l <- many anyChar return $ Right (DynamicLink l) let failure = return $ Left $ "Usage is :" ++ name ++ " [<library>]" try emptyArgs <|> try oneArg <|> failure
338
cmd_dynamic name = do let emptyArgs = noArgs ListDynamic name let oneArg = do l <- many anyChar return $ Right (DynamicLink l) let failure = return $ Left $ "Usage is :" ++ name ++ " [<library>]" try emptyArgs <|> try oneArg <|> failure
275
false
true
0
15
91
122
55
67
null
null
Concomitant/LambdaHack
GameDefinition/Content/ItemKindOrgan.hs
bsd-3-clause
torsionRight = fist { iname = "right torsion" , ifreq = [("right torsion", 100)] , icount = 1 , iverbHit = "twist" , iaspects = [Timeout $ 5 + d 5] , ieffects = [ Hurt (17 * d 1) , Recharging (toOrganGameTurn "slow 10" (3 + d 3)) ] , idesc = "" }
288
torsionRight = fist { iname = "right torsion" , ifreq = [("right torsion", 100)] , icount = 1 , iverbHit = "twist" , iaspects = [Timeout $ 5 + d 5] , ieffects = [ Hurt (17 * d 1) , Recharging (toOrganGameTurn "slow 10" (3 + d 3)) ] , idesc = "" }
288
torsionRight = fist { iname = "right torsion" , ifreq = [("right torsion", 100)] , icount = 1 , iverbHit = "twist" , iaspects = [Timeout $ 5 + d 5] , ieffects = [ Hurt (17 * d 1) , Recharging (toOrganGameTurn "slow 10" (3 + d 3)) ] , idesc = "" }
288
false
false
0
14
96
117
66
51
null
null
nh2/darcs-fastconvert
Export.hs
bsd-3-clause
tagName :: (PatchInfoAnd p) x y -> String tagName = map cleanup . drop 4 . patchName where cleanup x | x `elem` bad = '_' | otherwise = x -- FIXME many more chars are probably illegal bad = " ."
230
tagName :: (PatchInfoAnd p) x y -> String tagName = map cleanup . drop 4 . patchName where cleanup x | x `elem` bad = '_' | otherwise = x -- FIXME many more chars are probably illegal bad = " ."
230
tagName = map cleanup . drop 4 . patchName where cleanup x | x `elem` bad = '_' | otherwise = x -- FIXME many more chars are probably illegal bad = " ."
188
false
true
3
9
77
87
39
48
null
null
Mathnerd314/lamdu
src/Lamdu/CodeEdit/ExpressionEdit/HoleEdit/Results.hs
gpl-3.0
mResultsListOf :: HoleInfo m -> WidgetMaker m -> Widget.Id -> [(ResultType, Sugar.HoleResult Sugar.Name m ExprGuiM.Payload)] -> Maybe (ResultsList m) mResultsListOf _ _ _ [] = Nothing
189
mResultsListOf :: HoleInfo m -> WidgetMaker m -> Widget.Id -> [(ResultType, Sugar.HoleResult Sugar.Name m ExprGuiM.Payload)] -> Maybe (ResultsList m) mResultsListOf _ _ _ [] = Nothing
189
mResultsListOf _ _ _ [] = Nothing
33
false
true
0
12
31
77
38
39
null
null
flipstone/orville
orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/Expr/Query/SelectList.hs
mit
deriveColumn :: ValueExpression -> DerivedColumn deriveColumn = DerivedColumn . RawSql.toRawSql
97
deriveColumn :: ValueExpression -> DerivedColumn deriveColumn = DerivedColumn . RawSql.toRawSql
97
deriveColumn = DerivedColumn . RawSql.toRawSql
48
false
true
0
6
11
21
11
10
null
null
kylcarte/wangtiles
src/Util.hs
bsd-3-clause
tzip :: T.Traversable f => f a -> [b] -> f (a,b) tzip = tzipWith (,)
68
tzip :: T.Traversable f => f a -> [b] -> f (a,b) tzip = tzipWith (,)
68
tzip = tzipWith (,)
19
false
true
0
9
15
49
25
24
null
null
dalaing/type-systems
src/Ast/Term.hs
bsd-3-clause
astToType' f (TmAstKind ki) = fmap TyAstKind . bitransverse astToType' f $ ki
83
astToType' f (TmAstKind ki) = fmap TyAstKind . bitransverse astToType' f $ ki
83
astToType' f (TmAstKind ki) = fmap TyAstKind . bitransverse astToType' f $ ki
83
false
false
3
6
18
39
15
24
null
null
ml9951/ghc
libraries/base/Data/List/NonEmpty.hs
bsd-3-clause
-- | The 'nub' function removes duplicate elements from a list. In -- particular, it keeps only the first occurence of each element. -- (The name 'nub' means \'essence\'.) -- It is a special case of 'nubBy', which allows the programmer to -- supply their own inequality test. nub :: Eq a => NonEmpty a -> NonEmpty a nub = nubBy (==)
332
nub :: Eq a => NonEmpty a -> NonEmpty a nub = nubBy (==)
56
nub = nubBy (==)
16
true
true
0
8
61
44
22
22
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/UX/ACSS.hs
bsd-3-clause
-- Re-implementation of 'lines', for better efficiency (but decreased laziness). -- Also, importantly, accepts non-standard DOS and Mac line ending characters. -- And retains the trailing '\n' character in each resultant string. inlines :: String -> [String] inlines s = lines' s id where lines' [] acc = [acc []] lines' ('\^M':'\n':s) acc = acc ['\n'] : lines' s id -- DOS lines' ('\n':s) acc = acc ['\n'] : lines' s id -- Unix lines' (c:s) acc = lines' s (acc . (c:)) -- | The code for classify is largely stolen from Language.Preprocessor.Unlit.
589
inlines :: String -> [String] inlines s = lines' s id where lines' [] acc = [acc []] lines' ('\^M':'\n':s) acc = acc ['\n'] : lines' s id -- DOS lines' ('\n':s) acc = acc ['\n'] : lines' s id -- Unix lines' (c:s) acc = lines' s (acc . (c:)) -- | The code for classify is largely stolen from Language.Preprocessor.Unlit.
360
inlines s = lines' s id where lines' [] acc = [acc []] lines' ('\^M':'\n':s) acc = acc ['\n'] : lines' s id -- DOS lines' ('\n':s) acc = acc ['\n'] : lines' s id -- Unix lines' (c:s) acc = lines' s (acc . (c:)) -- | The code for classify is largely stolen from Language.Preprocessor.Unlit.
330
true
true
0
8
134
152
80
72
null
null
Bugfry/exercism
exercism/haskell/robot-simulator/src/Robot.hs
mit
simulate :: Robot -> String -> Robot simulate = foldl' execute
62
simulate :: Robot -> String -> Robot simulate = foldl' execute
62
simulate = foldl' execute
25
false
true
0
6
10
22
11
11
null
null
GaloisInc/ivory
ivory-opts/src/Ivory/Opts/ConstFold.hs
bsd-3-clause
constFoldInits :: CopyMap -> I.Init -> I.Init constFoldInits _ I.InitZero = I.InitZero
86
constFoldInits :: CopyMap -> I.Init -> I.Init constFoldInits _ I.InitZero = I.InitZero
86
constFoldInits _ I.InitZero = I.InitZero
40
false
true
0
9
11
38
17
21
null
null
brendanhay/gogol
gogol-bigtableadmin/gen/Network/Google/BigtableAdmin/Types/Product.hs
mpl-2.0
-- | The type of the restore source. rtmSourceType :: Lens' RestoreTableMetadata (Maybe RestoreTableMetadataSourceType) rtmSourceType = lens _rtmSourceType (\ s a -> s{_rtmSourceType = a})
196
rtmSourceType :: Lens' RestoreTableMetadata (Maybe RestoreTableMetadataSourceType) rtmSourceType = lens _rtmSourceType (\ s a -> s{_rtmSourceType = a})
159
rtmSourceType = lens _rtmSourceType (\ s a -> s{_rtmSourceType = a})
76
true
true
0
9
32
48
25
23
null
null
sdiehl/ghc
compiler/utils/Maybes.hs
bsd-3-clause
expectJust err Nothing = error ("expectJust " ++ err)
54
expectJust err Nothing = error ("expectJust " ++ err)
54
expectJust err Nothing = error ("expectJust " ++ err)
54
false
false
0
7
9
21
10
11
null
null
frasertweedale/wyas
src/Lib.hs
mit
makePort _ [a] = throwError $ TypeMismatch "string" a
54
makePort _ [a] = throwError $ TypeMismatch "string" a
54
makePort _ [a] = throwError $ TypeMismatch "string" a
54
false
false
0
6
9
23
11
12
null
null
phischu/fragnix
tests/packages/scotty/Data.IP.RouteTable.Internal.hs
bsd-3-clause
glue :: (Routable k) => Int -> AddrRange k -> AddrRange k -> AddrRange k glue n k1 k2 | addr k1 `masked` mk == addr k2 `masked` mk = glue (n + 1) k1 k2 | otherwise = makeAddrRange (addr k1) (n - 1) where mk = intToMask n
230
glue :: (Routable k) => Int -> AddrRange k -> AddrRange k -> AddrRange k glue n k1 k2 | addr k1 `masked` mk == addr k2 `masked` mk = glue (n + 1) k1 k2 | otherwise = makeAddrRange (addr k1) (n - 1) where mk = intToMask n
230
glue n k1 k2 | addr k1 `masked` mk == addr k2 `masked` mk = glue (n + 1) k1 k2 | otherwise = makeAddrRange (addr k1) (n - 1) where mk = intToMask n
157
false
true
1
11
59
130
63
67
null
null
christiaanb/clash-compiler
clash-ghc/src-ghc/CLaSH/GHC/GHC2Core.hs
bsd-2-clause
-- | Given the type: -- -- @ -- forall t.forall n.forall a.SClock t -> Vec n (Signal' t a) -> -- Signal' t (Vec n a) -- @ -- -- Generate the term: -- -- @ -- /\(t:Clock)./\(n:Nat)./\(a:*).\(sclk:SClock t).\(vs:Signal' (Vec n a)).vs -- @ vecUnwrapTerm :: C.Type -> C.Term vecUnwrapTerm (C.ForAllTy tvTTy) = C.TyLam (bind tTV ( C.TyLam (bind nTV ( C.TyLam (bind aTV ( C.Lam (bind sclkId ( C.Lam (bind vsId ( C.Var vsTy vsName)))))))))) where (tTV,nTV,aTV,funTy) = runFreshM $ do { (tTV',C.ForAllTy tvNTy) <- unbind tvTTy ; (nTV',C.ForAllTy tvATy) <- unbind tvNTy ; (aTV',funTy') <- unbind tvATy ; return (tTV',nTV',aTV',funTy') } (C.FunTy sclkTy funTy'') = C.tyView funTy (C.FunTy _ vsTy) = C.tyView funTy'' sclkName = string2Name "sclk" vsName = string2Name "vs" sclkId = C.Id sclkName (embed sclkTy) vsId = C.Id vsName (embed vsTy)
961
vecUnwrapTerm :: C.Type -> C.Term vecUnwrapTerm (C.ForAllTy tvTTy) = C.TyLam (bind tTV ( C.TyLam (bind nTV ( C.TyLam (bind aTV ( C.Lam (bind sclkId ( C.Lam (bind vsId ( C.Var vsTy vsName)))))))))) where (tTV,nTV,aTV,funTy) = runFreshM $ do { (tTV',C.ForAllTy tvNTy) <- unbind tvTTy ; (nTV',C.ForAllTy tvATy) <- unbind tvNTy ; (aTV',funTy') <- unbind tvATy ; return (tTV',nTV',aTV',funTy') } (C.FunTy sclkTy funTy'') = C.tyView funTy (C.FunTy _ vsTy) = C.tyView funTy'' sclkName = string2Name "sclk" vsName = string2Name "vs" sclkId = C.Id sclkName (embed sclkTy) vsId = C.Id vsName (embed vsTy)
724
vecUnwrapTerm (C.ForAllTy tvTTy) = C.TyLam (bind tTV ( C.TyLam (bind nTV ( C.TyLam (bind aTV ( C.Lam (bind sclkId ( C.Lam (bind vsId ( C.Var vsTy vsName)))))))))) where (tTV,nTV,aTV,funTy) = runFreshM $ do { (tTV',C.ForAllTy tvNTy) <- unbind tvTTy ; (nTV',C.ForAllTy tvATy) <- unbind tvNTy ; (aTV',funTy') <- unbind tvATy ; return (tTV',nTV',aTV',funTy') } (C.FunTy sclkTy funTy'') = C.tyView funTy (C.FunTy _ vsTy) = C.tyView funTy'' sclkName = string2Name "sclk" vsName = string2Name "vs" sclkId = C.Id sclkName (embed sclkTy) vsId = C.Id vsName (embed vsTy)
676
true
true
0
26
265
329
173
156
null
null
brendanhay/gogol
gogol-serviceconsumermanagement/gen/Network/Google/Resource/ServiceConsumerManagement/Services/TenancyUnits/AddProject.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). sUploadProtocol :: Lens' ServicesTenancyUnitsAddProject (Maybe Text) sUploadProtocol = lens _sUploadProtocol (\ s a -> s{_sUploadProtocol = a})
213
sUploadProtocol :: Lens' ServicesTenancyUnitsAddProject (Maybe Text) sUploadProtocol = lens _sUploadProtocol (\ s a -> s{_sUploadProtocol = a})
151
sUploadProtocol = lens _sUploadProtocol (\ s a -> s{_sUploadProtocol = a})
82
true
true
0
9
33
48
25
23
null
null
ihc/futhark
src/Futhark/Pass/ExtractKernels.hs
isc
transformStms :: [Stm] -> DistribM [KernelsStm] transformStms [] = return []
78
transformStms :: [Stm] -> DistribM [KernelsStm] transformStms [] = return []
78
transformStms [] = return []
30
false
true
0
8
12
39
18
21
null
null
bgamari/pandoc
src/Text/Pandoc/Readers/Docx/Parse.hs
gpl-2.0
archiveToNumbering' :: Archive -> Maybe Numbering archiveToNumbering' zf = do case findEntryByPath "word/numbering.xml" zf of Nothing -> Just $ Numbering [] [] [] Just entry -> do numberingElem <- (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry let namespaces = mapMaybe attrToNSPair (elAttribs numberingElem) numElems = findChildren (QName "num" (lookup "w" namespaces) (Just "w")) numberingElem absNumElems = findChildren (QName "abstractNum" (lookup "w" namespaces) (Just "w")) numberingElem nums = mapMaybe (numElemToNum namespaces) numElems absNums = mapMaybe (absNumElemToAbsNum namespaces) absNumElems return $ Numbering namespaces nums absNums
813
archiveToNumbering' :: Archive -> Maybe Numbering archiveToNumbering' zf = do case findEntryByPath "word/numbering.xml" zf of Nothing -> Just $ Numbering [] [] [] Just entry -> do numberingElem <- (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry let namespaces = mapMaybe attrToNSPair (elAttribs numberingElem) numElems = findChildren (QName "num" (lookup "w" namespaces) (Just "w")) numberingElem absNumElems = findChildren (QName "abstractNum" (lookup "w" namespaces) (Just "w")) numberingElem nums = mapMaybe (numElemToNum namespaces) numElems absNums = mapMaybe (absNumElemToAbsNum namespaces) absNumElems return $ Numbering namespaces nums absNums
813
archiveToNumbering' zf = do case findEntryByPath "word/numbering.xml" zf of Nothing -> Just $ Numbering [] [] [] Just entry -> do numberingElem <- (parseXMLDoc . UTF8.toStringLazy . fromEntry) entry let namespaces = mapMaybe attrToNSPair (elAttribs numberingElem) numElems = findChildren (QName "num" (lookup "w" namespaces) (Just "w")) numberingElem absNumElems = findChildren (QName "abstractNum" (lookup "w" namespaces) (Just "w")) numberingElem nums = mapMaybe (numElemToNum namespaces) numElems absNums = mapMaybe (absNumElemToAbsNum namespaces) absNumElems return $ Numbering namespaces nums absNums
763
false
true
0
19
239
222
106
116
null
null
brendanhay/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/AdvertiserLandingPages/List.hs
mpl-2.0
-- | Allows searching for landing pages by name or ID. Wildcards (*) are -- allowed. For example, \"landingpage*2017\" will return landing pages -- with names like \"landingpage July 2017\", \"landingpage March 2017\", -- or simply \"landingpage 2017\". Most of the searches also add wildcards -- implicitly at the start and the end of the search string. For example, a -- search string of \"landingpage\" will match campaigns with name \"my -- landingpage\", \"landingpage 2015\", or simply \"landingpage\". alplSearchString :: Lens' AdvertiserLandingPagesList (Maybe Text) alplSearchString = lens _alplSearchString (\ s a -> s{_alplSearchString = a})
660
alplSearchString :: Lens' AdvertiserLandingPagesList (Maybe Text) alplSearchString = lens _alplSearchString (\ s a -> s{_alplSearchString = a})
151
alplSearchString = lens _alplSearchString (\ s a -> s{_alplSearchString = a})
85
true
true
1
9
102
57
31
26
null
null
gchrupala/morfette
src/GramLab/Data/Diff/FuzzyEditTree.hs
bsd-2-clause
fuzzyScore (FuzzyMatch _ _ _ _ d) = d
37
fuzzyScore (FuzzyMatch _ _ _ _ d) = d
37
fuzzyScore (FuzzyMatch _ _ _ _ d) = d
37
false
false
0
7
8
23
11
12
null
null
pparkkin/eta
shake/Build.hs
bsd-3-clause
getEtlasLibDir = do etlasDir <- getEtlasDir etaVersion <- getEtaNumericVersion let etlasLibDir = etlasDir </> "lib" etaWithVersion = "eta-" ++ etaVersion findFileOrDir etaWithVersion etlasLibDir
208
getEtlasLibDir = do etlasDir <- getEtlasDir etaVersion <- getEtaNumericVersion let etlasLibDir = etlasDir </> "lib" etaWithVersion = "eta-" ++ etaVersion findFileOrDir etaWithVersion etlasLibDir
208
getEtlasLibDir = do etlasDir <- getEtlasDir etaVersion <- getEtaNumericVersion let etlasLibDir = etlasDir </> "lib" etaWithVersion = "eta-" ++ etaVersion findFileOrDir etaWithVersion etlasLibDir
208
false
false
0
10
36
50
23
27
null
null
konn/gitolist
Encodings.hs
bsd-2-clause
detectEncoding bs = unsafePerformIO $ D.detectEncoding $ LBS.fromChunks [bs]
76
detectEncoding bs = unsafePerformIO $ D.detectEncoding $ LBS.fromChunks [bs]
76
detectEncoding bs = unsafePerformIO $ D.detectEncoding $ LBS.fromChunks [bs]
76
false
false
0
7
8
27
13
14
null
null
noughtmare/yi
yi-keymap-vim/src/Yi/Keymap/Vim/Digraph.hs
gpl-2.0
-- SUBSCRIPT PLUS SIGN switch '-' 's' = '\x208B'
48
switch '-' 's' = '\x208B'
25
switch '-' 's' = '\x208B'
25
true
false
0
5
8
12
6
6
null
null
triplepointfive/hogldev
tutorial28/Tutorial28.hs
mit
keyboardCB _ _ = return ()
27
keyboardCB _ _ = return ()
27
keyboardCB _ _ = return ()
27
false
false
0
6
6
16
7
9
null
null
amccausl/Swish
Swish/HaskellRDF/GraphTest.hs
lgpl-2.1
g208 = arcsToGraph [ t10102, t10203, t10304, f10405, f10501, t10106, t10207, t10308, t10409, t10510, t10607, t10708, t10809, t10910, t11006 ]
169
g208 = arcsToGraph [ t10102, t10203, t10304, f10405, f10501, t10106, t10207, t10308, t10409, t10510, t10607, t10708, t10809, t10910, t11006 ]
169
g208 = arcsToGraph [ t10102, t10203, t10304, f10405, f10501, t10106, t10207, t10308, t10409, t10510, t10607, t10708, t10809, t10910, t11006 ]
169
false
false
0
6
47
54
34
20
null
null
hsyl20/ViperVM
haskus-system-tools/src/elf/Main.hs
bsd-3-clause
segmentsPage :: FilePath -> Elf -> Html () segmentsPage pth elf = do p_ . toHtml $ "Info about: " ++ pth h2_ "Segments" showSegments elf
145
segmentsPage :: FilePath -> Elf -> Html () segmentsPage pth elf = do p_ . toHtml $ "Info about: " ++ pth h2_ "Segments" showSegments elf
145
segmentsPage pth elf = do p_ . toHtml $ "Info about: " ++ pth h2_ "Segments" showSegments elf
102
false
true
0
9
34
56
25
31
null
null
AlexeyRaga/eta
compiler/ETA/Main/DynFlags.hs
bsd-3-clause
addIncludePath p = upd (\s -> s{includePaths = includePaths s ++ splitPathList p})
84
addIncludePath p = upd (\s -> s{includePaths = includePaths s ++ splitPathList p})
84
addIncludePath p = upd (\s -> s{includePaths = includePaths s ++ splitPathList p})
84
false
false
1
11
14
42
19
23
null
null
kojiromike/Idris-dev
src/Idris/Elab/Data.hs
bsd-3-clause
elabData :: ElabInfo -> SyntaxInfo -> Docstring (Either Err PTerm)-> [(Name, Docstring (Either Err PTerm))] -> FC -> DataOpts -> PData -> Idris () elabData info syn doc argDocs fc opts (PLaterdecl n nfc t_in) = do logElab 1 (show (fc, doc)) checkUndefined fc n when (implicitable (nsroot n)) $ warnLC fc n (cty, _, t, inacc) <- buildType info syn fc [] n t_in addIBC (IBCDef n) updateContext (addTyDecl n (TCon 0 0) cty) -- temporary, to check cons sendHighlighting $ S.fromList [(FC' nfc, AnnName n Nothing Nothing Nothing)]
584
elabData :: ElabInfo -> SyntaxInfo -> Docstring (Either Err PTerm)-> [(Name, Docstring (Either Err PTerm))] -> FC -> DataOpts -> PData -> Idris () elabData info syn doc argDocs fc opts (PLaterdecl n nfc t_in) = do logElab 1 (show (fc, doc)) checkUndefined fc n when (implicitable (nsroot n)) $ warnLC fc n (cty, _, t, inacc) <- buildType info syn fc [] n t_in addIBC (IBCDef n) updateContext (addTyDecl n (TCon 0 0) cty) -- temporary, to check cons sendHighlighting $ S.fromList [(FC' nfc, AnnName n Nothing Nothing Nothing)]
584
elabData info syn doc argDocs fc opts (PLaterdecl n nfc t_in) = do logElab 1 (show (fc, doc)) checkUndefined fc n when (implicitable (nsroot n)) $ warnLC fc n (cty, _, t, inacc) <- buildType info syn fc [] n t_in addIBC (IBCDef n) updateContext (addTyDecl n (TCon 0 0) cty) -- temporary, to check cons sendHighlighting $ S.fromList [(FC' nfc, AnnName n Nothing Nothing Nothing)]
437
false
true
0
13
148
259
126
133
null
null
mcjohnalds/jumpy
src/Utils.hs
mit
screenHeight = 500
18
screenHeight = 500
18
screenHeight = 500
18
false
false
0
4
2
6
3
3
null
null
rueshyna/gogol
gogol-servicecontrol/gen/Network/Google/ServiceControl/Types/Product.hs
mpl-2.0
-- | The user agent of the caller. This information is not authenticated and -- should be treated accordingly. For example: + -- \`google-api-python-client\/1.4.0\`: The request was made by the Google -- API client for Python. + \`Cloud SDK Command Line Tool -- apitools-client\/1.0 gcloud\/0.9.62\`: The request was made by the -- Google Cloud SDK CLI (gcloud). + \`AppEngine-Google; -- (+http:\/\/code.google.com\/appengine; appid: s~my-project\`: The -- request was made from the \`my-project\` App Engine app. rmCallerSuppliedUserAgent :: Lens' RequestMetadata (Maybe Text) rmCallerSuppliedUserAgent = lens _rmCallerSuppliedUserAgent (\ s a -> s{_rmCallerSuppliedUserAgent = a})
690
rmCallerSuppliedUserAgent :: Lens' RequestMetadata (Maybe Text) rmCallerSuppliedUserAgent = lens _rmCallerSuppliedUserAgent (\ s a -> s{_rmCallerSuppliedUserAgent = a})
176
rmCallerSuppliedUserAgent = lens _rmCallerSuppliedUserAgent (\ s a -> s{_rmCallerSuppliedUserAgent = a})
112
true
true
0
8
98
56
32
24
null
null
antalsz/hs-to-coq
examples/graph/graph/Data/Graph/Inductive/Query/MaxFlow2.hs
mit
pathFromDirPath :: DirPath -> [Node] pathFromDirPath = map fst
62
pathFromDirPath :: DirPath -> [Node] pathFromDirPath = map fst
62
pathFromDirPath = map fst
25
false
true
0
6
8
21
11
10
null
null
chadbrewbaker/combinat
Math/Combinat/Trees/Nary.hs
bsd-3-clause
------------------------------------------------------------------------------- -- | All trees on @n@ nodes where the number of children of all nodes is -- in element of the given set. Example: -- -- > autoTabulate RowMajor (Right 5) $ map asciiTreeVertical -- > $ map labelNChildrenTree_ -- > $ semiRegularTrees [2,3] 2 -- > -- > [ length $ semiRegularTrees [2,3] n | n<-[0..] ] == [1,2,10,66,498,4066,34970,312066,2862562,26824386,...] -- -- The latter sequence is A027307 in OEIS: <https://oeis.org/A027307> -- -- Remark: clearly, we have -- -- > semiRegularTrees [d] n == regularNaryTrees d n -- -- semiRegularTrees :: [Int] -- ^ set of allowed number of children -> Int -- ^ number of nodes -> [Tree ()] semiRegularTrees [] n = if n==0 then [Node () []] else []
863
semiRegularTrees :: [Int] -- ^ set of allowed number of children -> Int -- ^ number of nodes -> [Tree ()] semiRegularTrees [] n = if n==0 then [Node () []] else []
191
semiRegularTrees [] n = if n==0 then [Node () []] else []
60
true
true
0
11
218
87
53
34
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/course/2013-11-nicta/src/Course/Apply.hs
unlicense
tao :: [T.Test] tao = U.tt "tao" [ Full (+8) <*> Full 7 , bindOptional (`mapOptional` (Full 7)) (Full (+8)) -- def of <*> for Optional , (`mapOptional` (Full 7)) (+8) -- def of bindOptional (removes "container" from second arg) , (+8) `mapOptional` (Full 7) -- partial "left" application , (Full ((+8) 7)) -- definition of mapOptional ] (Full 15)
464
tao :: [T.Test] tao = U.tt "tao" [ Full (+8) <*> Full 7 , bindOptional (`mapOptional` (Full 7)) (Full (+8)) -- def of <*> for Optional , (`mapOptional` (Full 7)) (+8) -- def of bindOptional (removes "container" from second arg) , (+8) `mapOptional` (Full 7) -- partial "left" application , (Full ((+8) 7)) -- definition of mapOptional ] (Full 15)
464
tao = U.tt "tao" [ Full (+8) <*> Full 7 , bindOptional (`mapOptional` (Full 7)) (Full (+8)) -- def of <*> for Optional , (`mapOptional` (Full 7)) (+8) -- def of bindOptional (removes "container" from second arg) , (+8) `mapOptional` (Full 7) -- partial "left" application , (Full ((+8) 7)) -- definition of mapOptional ] (Full 15)
448
false
true
0
11
177
148
85
63
null
null
thalerjonathan/phd
thesis/code/sir/src/test/Utils/Stats.hs
gpl-3.0
avgTest :: [Double] -> Double -> Double -> Bool avgTest ys mu0 eps = abs (mu - mu0) <= eps where mu = Utils.Stats.mean ys
156
avgTest :: [Double] -> Double -> Double -> Bool avgTest ys mu0 eps = abs (mu - mu0) <= eps where mu = Utils.Stats.mean ys
156
avgTest ys mu0 eps = abs (mu - mu0) <= eps where mu = Utils.Stats.mean ys
84
false
true
0
8
59
61
31
30
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/RevokeSecurityGroupIngress.hs
mpl-2.0
-- | The start of port range for the TCP and UDP protocols, or an ICMP type -- number. For the ICMP type number, use '-1' to specify all ICMP types. rsgiFromPort :: Lens' RevokeSecurityGroupIngress (Maybe Int) rsgiFromPort = lens _rsgiFromPort (\s a -> s { _rsgiFromPort = a })
277
rsgiFromPort :: Lens' RevokeSecurityGroupIngress (Maybe Int) rsgiFromPort = lens _rsgiFromPort (\s a -> s { _rsgiFromPort = a })
128
rsgiFromPort = lens _rsgiFromPort (\s a -> s { _rsgiFromPort = a })
67
true
true
0
9
49
47
26
21
null
null
Heather/Idris-dev
src/Idris/Coverage.hs
bsd-3-clause
checkRec _ _ = return False
27
checkRec _ _ = return False
27
checkRec _ _ = return False
27
false
false
1
5
5
15
6
9
null
null
yanatan16/doczen-generator
src/Language/Doczen/PrettyPrint.hs
mit
sectionOpt (NoAttachedRepl) = text "!norepl\n"
46
sectionOpt (NoAttachedRepl) = text "!norepl\n"
46
sectionOpt (NoAttachedRepl) = text "!norepl\n"
46
false
false
0
5
4
16
7
9
null
null
hanshoglund/hslinks
src/hslinks.hs
bsd-3-clause
generateIndexLink :: [(PackageName, ModuleName)] -> Identifier -> String generateIndexLink !sources ident = let vOrT = if isUpper (head ident) then "t" else "v" in case whichModule (fmap snd sources) (wrapOp ident) of Left e -> "[" ++ ident ++ "]: " ++ "\n<!-- Unknown: " ++ ident ++ " " ++ e ++ "-->\n" Right modName -> -- TODO -- TODO This should be optional let package = fromJust $ whichPackage sources modName in "" ++ "[" ++ ident ++ "]: " ++ kPrefix ++ package ++ "/" ++ replace '.' '-' modName ++ ".html" ++ "#" ++ vOrT ++ ":" ++ handleOp ident ++ "" where -- FIXME kPrefix = "/docs/api/" swap (x,y) = (y,x) whichPackage sources x = lookup x (fmap swap sources) -- If the given identifier is an operator, wrap it in parentheses -- Necessary to make the search work wrapOp :: Identifier -> Identifier wrapOp [] = [] wrapOp as@(x:_) | isAlphaNum x = as | otherwise = "(" ++ as ++ ")" -- If the given identifier is an operator, escape it handleOp :: Identifier -> Identifier handleOp [] = [] handleOp as@(x:_) | isAlphaNum x = as | otherwise = escapeOp as -- Escape an operator a la Haddock escapeOp = concatMap (\c -> "-" ++ show (ord c) ++ "-")
1,520
generateIndexLink :: [(PackageName, ModuleName)] -> Identifier -> String generateIndexLink !sources ident = let vOrT = if isUpper (head ident) then "t" else "v" in case whichModule (fmap snd sources) (wrapOp ident) of Left e -> "[" ++ ident ++ "]: " ++ "\n<!-- Unknown: " ++ ident ++ " " ++ e ++ "-->\n" Right modName -> -- TODO -- TODO This should be optional let package = fromJust $ whichPackage sources modName in "" ++ "[" ++ ident ++ "]: " ++ kPrefix ++ package ++ "/" ++ replace '.' '-' modName ++ ".html" ++ "#" ++ vOrT ++ ":" ++ handleOp ident ++ "" where -- FIXME kPrefix = "/docs/api/" swap (x,y) = (y,x) whichPackage sources x = lookup x (fmap swap sources) -- If the given identifier is an operator, wrap it in parentheses -- Necessary to make the search work wrapOp :: Identifier -> Identifier wrapOp [] = [] wrapOp as@(x:_) | isAlphaNum x = as | otherwise = "(" ++ as ++ ")" -- If the given identifier is an operator, escape it handleOp :: Identifier -> Identifier handleOp [] = [] handleOp as@(x:_) | isAlphaNum x = as | otherwise = escapeOp as -- Escape an operator a la Haddock escapeOp = concatMap (\c -> "-" ++ show (ord c) ++ "-")
1,520
generateIndexLink !sources ident = let vOrT = if isUpper (head ident) then "t" else "v" in case whichModule (fmap snd sources) (wrapOp ident) of Left e -> "[" ++ ident ++ "]: " ++ "\n<!-- Unknown: " ++ ident ++ " " ++ e ++ "-->\n" Right modName -> -- TODO -- TODO This should be optional let package = fromJust $ whichPackage sources modName in "" ++ "[" ++ ident ++ "]: " ++ kPrefix ++ package ++ "/" ++ replace '.' '-' modName ++ ".html" ++ "#" ++ vOrT ++ ":" ++ handleOp ident ++ "" where -- FIXME kPrefix = "/docs/api/" swap (x,y) = (y,x) whichPackage sources x = lookup x (fmap swap sources) -- If the given identifier is an operator, wrap it in parentheses -- Necessary to make the search work wrapOp :: Identifier -> Identifier wrapOp [] = [] wrapOp as@(x:_) | isAlphaNum x = as | otherwise = "(" ++ as ++ ")" -- If the given identifier is an operator, escape it handleOp :: Identifier -> Identifier handleOp [] = [] handleOp as@(x:_) | isAlphaNum x = as | otherwise = escapeOp as -- Escape an operator a la Haddock escapeOp = concatMap (\c -> "-" ++ show (ord c) ++ "-")
1,447
false
true
0
24
586
428
216
212
null
null
brendanhay/gogol
gogol-logging/gen/Network/Google/Resource/Logging/Projects/Metrics/List.hs
mpl-2.0
-- | V1 error format. pmlXgafv :: Lens' ProjectsMetricsList (Maybe Xgafv) pmlXgafv = lens _pmlXgafv (\ s a -> s{_pmlXgafv = a})
127
pmlXgafv :: Lens' ProjectsMetricsList (Maybe Xgafv) pmlXgafv = lens _pmlXgafv (\ s a -> s{_pmlXgafv = a})
105
pmlXgafv = lens _pmlXgafv (\ s a -> s{_pmlXgafv = a})
53
true
true
0
9
21
46
25
21
null
null
acowley/ghc
compiler/prelude/ForeignCall.hs
bsd-3-clause
playSafe PlayInterruptible = True
33
playSafe PlayInterruptible = True
33
playSafe PlayInterruptible = True
33
false
false
0
4
3
10
4
6
null
null
spire/spire
src/Spire/Surface/PrettyPrinter.hs
bsd-3-clause
listM xs = PP.list <$> sequence xs
37
listM xs = PP.list <$> sequence xs
37
listM xs = PP.list <$> sequence xs
37
false
false
3
5
9
22
8
14
null
null
thalerjonathan/phd
coding/libraries/chimera/src/FRP/Chimera/Rendering/Continuous2d.hs
gpl-3.0
defaultAgentRendererCont2d :: Float -> AgentColorerCont2d s -> AgentCoordCont2d s -> AgentRendererCont2d s defaultAgentRendererCont2d size acf apf (sx, sy) (wx, wy) _t (_, s) = GLO.color color $ GLO.translate xPix yPix $ GLO.ThickCircle 0 size where (x, y) = apf s color = acf s halfXSize = fromRational (toRational wx / 2.0) halfYSize = fromRational (toRational wy / 2.0) xPix = fromRational (toRational (x * sx)) - halfXSize yPix = fromRational (toRational (y * sy)) - halfYSize
508
defaultAgentRendererCont2d :: Float -> AgentColorerCont2d s -> AgentCoordCont2d s -> AgentRendererCont2d s defaultAgentRendererCont2d size acf apf (sx, sy) (wx, wy) _t (_, s) = GLO.color color $ GLO.translate xPix yPix $ GLO.ThickCircle 0 size where (x, y) = apf s color = acf s halfXSize = fromRational (toRational wx / 2.0) halfYSize = fromRational (toRational wy / 2.0) xPix = fromRational (toRational (x * sx)) - halfXSize yPix = fromRational (toRational (y * sy)) - halfYSize
508
defaultAgentRendererCont2d size acf apf (sx, sy) (wx, wy) _t (_, s) = GLO.color color $ GLO.translate xPix yPix $ GLO.ThickCircle 0 size where (x, y) = apf s color = acf s halfXSize = fromRational (toRational wx / 2.0) halfYSize = fromRational (toRational wy / 2.0) xPix = fromRational (toRational (x * sx)) - halfXSize yPix = fromRational (toRational (y * sy)) - halfYSize
401
false
true
0
10
103
204
103
101
null
null
kevinbackhouse/Control-Monad-MultiPass
tests/TestAssembler.hs
bsd-3-clause
-- Generate an example input containing some add instructions, labels, -- and gotos. The argument n determines the size of the example -- generated. genExample :: Int -> [Instruction] genExample n = concat [ [ Label $ LabelName $ show i , AddImm8 (Register 0) (fromIntegral i) ] | i <- [0 .. n-1] ] ++ concat [ [ Goto $ LabelName $ show (n - i - 1) , AddImm8 (Register 0) (fromIntegral i) ] | i <- [0 .. n-1] ]
462
genExample :: Int -> [Instruction] genExample n = concat [ [ Label $ LabelName $ show i , AddImm8 (Register 0) (fromIntegral i) ] | i <- [0 .. n-1] ] ++ concat [ [ Goto $ LabelName $ show (n - i - 1) , AddImm8 (Register 0) (fromIntegral i) ] | i <- [0 .. n-1] ]
313
genExample n = concat [ [ Label $ LabelName $ show i , AddImm8 (Register 0) (fromIntegral i) ] | i <- [0 .. n-1] ] ++ concat [ [ Goto $ LabelName $ show (n - i - 1) , AddImm8 (Register 0) (fromIntegral i) ] | i <- [0 .. n-1] ]
278
true
true
2
12
134
162
83
79
null
null
YueLiPicasso/unification
ReadPrintTerms.hs
gpl-3.0
isFunction _ = False
20
isFunction _ = False
20
isFunction _ = False
20
false
false
0
4
3
10
4
6
null
null
Helium4Haskell/helium
test/typeClasses/ClassInstance4.hs
gpl-3.0
main = show (g 'a' + 1)
23
main = show (g 'a' + 1)
23
main = show (g 'a' + 1)
23
false
false
1
8
6
23
9
14
null
null
acowley/ghc
compiler/coreSyn/CoreStats.hs
bsd-3-clause
exprSize (Lit lit) = lit `seq` 1
38
exprSize (Lit lit) = lit `seq` 1
38
exprSize (Lit lit) = lit `seq` 1
38
false
false
0
6
12
22
11
11
null
null
siddhanathan/ghc
compiler/prelude/THNames.hs
bsd-3-clause
roleTyConKey = mkPreludeTyConUnique 229
50
roleTyConKey = mkPreludeTyConUnique 229
50
roleTyConKey = mkPreludeTyConUnique 229
50
false
false
0
5
14
9
4
5
null
null
hackern/halfs
test/src/Tests/Serdes.hs
bsd-3-clause
propM_extSerdes :: HalfsCapable b UTCTime r l m => BDGeom -> BlockDevice m -> PropertyM m () propM_extSerdes _g dev = forAllM (arbitrary :: Gen Ext) $ \ext -> do -- NB: We fill in the numAddrs field of the arbitrary Ext here based on the -- device geometry rather than using the value given to us by the generator, -- which is arbitrary. nAddrs <- computeNumAddrs (bdBlockSize dev) minExtBlocks =<< minimalExtSize runHNoEnv (decodeExt (bdBlockSize dev) (encode ext)) >>= assert . either (const False) (== ext{ numAddrs = nAddrs })
601
propM_extSerdes :: HalfsCapable b UTCTime r l m => BDGeom -> BlockDevice m -> PropertyM m () propM_extSerdes _g dev = forAllM (arbitrary :: Gen Ext) $ \ext -> do -- NB: We fill in the numAddrs field of the arbitrary Ext here based on the -- device geometry rather than using the value given to us by the generator, -- which is arbitrary. nAddrs <- computeNumAddrs (bdBlockSize dev) minExtBlocks =<< minimalExtSize runHNoEnv (decodeExt (bdBlockSize dev) (encode ext)) >>= assert . either (const False) (== ext{ numAddrs = nAddrs })
601
propM_extSerdes _g dev = forAllM (arbitrary :: Gen Ext) $ \ext -> do -- NB: We fill in the numAddrs field of the arbitrary Ext here based on the -- device geometry rather than using the value given to us by the generator, -- which is arbitrary. nAddrs <- computeNumAddrs (bdBlockSize dev) minExtBlocks =<< minimalExtSize runHNoEnv (decodeExt (bdBlockSize dev) (encode ext)) >>= assert . either (const False) (== ext{ numAddrs = nAddrs })
451
false
true
0
16
160
157
77
80
null
null
jvilar/hrows
lib/Model/Expression.hs
gpl-2.0
merge (x:xs) (y:ys) = case compare x y of LT -> x : merge xs (y:ys) EQ -> x : merge xs ys GT -> y : merge (x:xs) ys
193
merge (x:xs) (y:ys) = case compare x y of LT -> x : merge xs (y:ys) EQ -> x : merge xs ys GT -> y : merge (x:xs) ys
193
merge (x:xs) (y:ys) = case compare x y of LT -> x : merge xs (y:ys) EQ -> x : merge xs ys GT -> y : merge (x:xs) ys
193
false
false
0
11
107
95
46
49
null
null
spechub/Hets
CMDL/Interface.hs
gpl-2.0
hasSlash :: String -> Bool hasSlash x = case x of '\\' : _ -> True ' ' : ls -> hasSlash ls '\n' : ls -> hasSlash ls _ -> False
158
hasSlash :: String -> Bool hasSlash x = case x of '\\' : _ -> True ' ' : ls -> hasSlash ls '\n' : ls -> hasSlash ls _ -> False
158
hasSlash x = case x of '\\' : _ -> True ' ' : ls -> hasSlash ls '\n' : ls -> hasSlash ls _ -> False
131
false
true
0
8
63
70
32
38
null
null
NICTA/sk-config
src/OutputC.hs
bsd-2-clause
-- Various function definitions: regionSize :: String -> Integer -> String regionSize region_name size = unlines ["size_t region_" ++ region_name ++ "_size(void) {", "return " ++ (show size) ++ ";", "}"]
223
regionSize :: String -> Integer -> String regionSize region_name size = unlines ["size_t region_" ++ region_name ++ "_size(void) {", "return " ++ (show size) ++ ";", "}"]
190
regionSize region_name size = unlines ["size_t region_" ++ region_name ++ "_size(void) {", "return " ++ (show size) ++ ";", "}"]
148
true
true
0
10
50
65
32
33
null
null
Palmik/wai-sockjs
src/Control/Monad/Trans/Resource/Extra.hs
bsd-3-clause
registerF :: R.MonadResource m => (a -> IO ()) -> a -> m (ReleaseKeyF a) registerF f a0 = do ref <- liftIO $ newIORef a0 key <- R.register $ readIORef ref >>= f return $! ReleaseKeyF ref key
232
registerF :: R.MonadResource m => (a -> IO ()) -> a -> m (ReleaseKeyF a) registerF f a0 = do ref <- liftIO $ newIORef a0 key <- R.register $ readIORef ref >>= f return $! ReleaseKeyF ref key
232
registerF f a0 = do ref <- liftIO $ newIORef a0 key <- R.register $ readIORef ref >>= f return $! ReleaseKeyF ref key
129
false
true
0
10
80
100
46
54
null
null
alexander-at-github/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
primOpInfo GetCCSOfOp = mkGenPrimOp (fsLit "getCCSOf#") [alphaTyVar, deltaTyVar] [alphaTy, mkStatePrimTy deltaTy] ((mkTupleTy UnboxedTuple [mkStatePrimTy deltaTy, addrPrimTy]))
177
primOpInfo GetCCSOfOp = mkGenPrimOp (fsLit "getCCSOf#") [alphaTyVar, deltaTyVar] [alphaTy, mkStatePrimTy deltaTy] ((mkTupleTy UnboxedTuple [mkStatePrimTy deltaTy, addrPrimTy]))
177
primOpInfo GetCCSOfOp = mkGenPrimOp (fsLit "getCCSOf#") [alphaTyVar, deltaTyVar] [alphaTy, mkStatePrimTy deltaTy] ((mkTupleTy UnboxedTuple [mkStatePrimTy deltaTy, addrPrimTy]))
177
false
false
0
10
16
59
31
28
null
null
ambiata/mafia
src/Mafia/P.hs
bsd-3-clause
-- | Logical conjunction. andA :: Applicative f => f Bool -> f Bool -> f Bool andA = liftA2 (&&)
98
andA :: Applicative f => f Bool -> f Bool -> f Bool andA = liftA2 (&&)
72
andA = liftA2 (&&)
20
true
true
0
8
22
41
20
21
null
null
ml9951/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes")
52
gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes")
52
gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes")
52
false
false
0
7
8
15
7
8
null
null
mikusp/accelerate-cuda
Data/Array/Accelerate/CUDA/CodeGen/Base.hs
bsd-3-clause
-- Kernel function parameters -- -------------------------- -- Generate kernel parameters for an array valued argument, and a function to -- linearly index this array. Note that dimensional indexing results in error. -- readArray :: forall aenv sh e. (Shape sh, Elt e) => Name -- group names -> Array sh e -- dummy to fix types -> ( [C.Param] , [C.Exp] , CUDelayedAcc aenv sh e ) readArray grp dummy = let (sh, arrs) = namesOfArray grp (undefined :: e) args = arrayAsArg dummy grp dim = expDim (undefined :: Exp aenv sh) sh' = cshape dim sh get ix = ([], map (\a -> [cexp| $id:a [ $exp:ix ] |]) arrs) manifest = CUDelayed (CUExp ([], sh')) ($internalError "readArray" "linear indexing only") (CUFun1 (zip (repeat True)) (\[i] -> get (rvalue i))) in ( args, sh', manifest )
1,028
readArray :: forall aenv sh e. (Shape sh, Elt e) => Name -- group names -> Array sh e -- dummy to fix types -> ( [C.Param] , [C.Exp] , CUDelayedAcc aenv sh e ) readArray grp dummy = let (sh, arrs) = namesOfArray grp (undefined :: e) args = arrayAsArg dummy grp dim = expDim (undefined :: Exp aenv sh) sh' = cshape dim sh get ix = ([], map (\a -> [cexp| $id:a [ $exp:ix ] |]) arrs) manifest = CUDelayed (CUExp ([], sh')) ($internalError "readArray" "linear indexing only") (CUFun1 (zip (repeat True)) (\[i] -> get (rvalue i))) in ( args, sh', manifest )
807
readArray grp dummy = let (sh, arrs) = namesOfArray grp (undefined :: e) args = arrayAsArg dummy grp dim = expDim (undefined :: Exp aenv sh) sh' = cshape dim sh get ix = ([], map (\a -> [cexp| $id:a [ $exp:ix ] |]) arrs) manifest = CUDelayed (CUExp ([], sh')) ($internalError "readArray" "linear indexing only") (CUFun1 (zip (repeat True)) (\[i] -> get (rvalue i))) in ( args, sh', manifest )
567
true
true
0
16
393
275
150
125
null
null