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
ganeti/ganeti
src/Ganeti/Query/Server.hs
bsd-2-clause
handleCall _ _ cfg (QueryNodes names fields lock) = handleClassicQuery cfg (Qlang.ItemTypeOpCode Qlang.QRNode) (map Left names) fields lock
145
handleCall _ _ cfg (QueryNodes names fields lock) = handleClassicQuery cfg (Qlang.ItemTypeOpCode Qlang.QRNode) (map Left names) fields lock
145
handleCall _ _ cfg (QueryNodes names fields lock) = handleClassicQuery cfg (Qlang.ItemTypeOpCode Qlang.QRNode) (map Left names) fields lock
145
false
false
0
8
23
54
26
28
null
null
noteed/game-packet
Network/Game/Connection.hs
bsd-3-clause
client :: Address -> B.ByteString -> Float -> Int -> IO (Maybe Client) client addr protocol timeout port = do msock <- Socket.socket port 1024 case msock of Nothing -> return Nothing Just sock -> do s <- newIORef ClientConnecting e <- newIORef 0 return . Just $ Client protocol timeout sock...
329
client :: Address -> B.ByteString -> Float -> Int -> IO (Maybe Client) client addr protocol timeout port = do msock <- Socket.socket port 1024 case msock of Nothing -> return Nothing Just sock -> do s <- newIORef ClientConnecting e <- newIORef 0 return . Just $ Client protocol timeout sock...
329
client addr protocol timeout port = do msock <- Socket.socket port 1024 case msock of Nothing -> return Nothing Just sock -> do s <- newIORef ClientConnecting e <- newIORef 0 return . Just $ Client protocol timeout sock s e addr
258
false
true
0
15
84
137
60
77
null
null
keera-studios/hsQt
Qtc/Gui/QComboBox.hs
bsd-2-clause
setView :: QComboBox a -> ((QAbstractItemView t1)) -> IO () setView x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QComboBox_setView cobj_x0 cobj_x1
187
setView :: QComboBox a -> ((QAbstractItemView t1)) -> IO () setView x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QComboBox_setView cobj_x0 cobj_x1
187
setView x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QComboBox_setView cobj_x0 cobj_x1
127
false
true
0
9
36
73
36
37
null
null
shlevy/ghc
testsuite/tests/profiling/should_run/T3001-2.hs
bsd-3-clause
eadN :: Int -> (S.ByteString -> a) -> Get a readN n f = fmap f $ getBytes n
76
readN :: Int -> (S.ByteString -> a) -> Get a readN n f = fmap f $ getBytes n
76
readN n f = fmap f $ getBytes n
31
false
true
0
9
19
46
22
24
null
null
vikraman/ghc
compiler/utils/UniqDFM.hs
bsd-3-clause
minusUDFM :: UniqDFM elt1 -> UniqDFM elt2 -> UniqDFM elt1 minusUDFM (UDFM x i) (UDFM y _j) = UDFM (M.difference x y) i
118
minusUDFM :: UniqDFM elt1 -> UniqDFM elt2 -> UniqDFM elt1 minusUDFM (UDFM x i) (UDFM y _j) = UDFM (M.difference x y) i
118
minusUDFM (UDFM x i) (UDFM y _j) = UDFM (M.difference x y) i
60
false
true
0
10
22
68
31
37
null
null
pparkkin/eta
compiler/ETA/StgSyn/CoreToStg.hs
bsd-3-clause
unionLiveInfo :: LiveInfo -> LiveInfo -> LiveInfo unionLiveInfo (lv1,caf1) (lv2,caf2) = (lv1 `unionVarSet` lv2, caf1 `unionVarSet` caf2)
136
unionLiveInfo :: LiveInfo -> LiveInfo -> LiveInfo unionLiveInfo (lv1,caf1) (lv2,caf2) = (lv1 `unionVarSet` lv2, caf1 `unionVarSet` caf2)
136
unionLiveInfo (lv1,caf1) (lv2,caf2) = (lv1 `unionVarSet` lv2, caf1 `unionVarSet` caf2)
86
false
true
0
6
16
54
32
22
null
null
frantisekfarka/ghc-dsi
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
narrowOp _ = Nothing
33
narrowOp _ = Nothing
33
narrowOp _ = Nothing
33
false
false
0
4
16
10
4
6
null
null
abhinav/tbr
TBR/Util.hs
mit
-- | @l `tokenMatch` r@ checks if all tokens of @l@ are in @r@. tokenMatch :: Text -> Text -> Bool tokenMatch = isInfixOf `on` tokens
133
tokenMatch :: Text -> Text -> Bool tokenMatch = isInfixOf `on` tokens
69
tokenMatch = isInfixOf `on` tokens
34
true
true
0
6
25
26
15
11
null
null
DavidAlphaFox/ghc
utils/haddock/haddock-library/src/Documentation/Haddock/Parser/Monad.hs
bsd-3-clause
takeWhile1 :: (Char -> Bool) -> Parser ByteString takeWhile1 = lift . Attoparsec.takeWhile1
91
takeWhile1 :: (Char -> Bool) -> Parser ByteString takeWhile1 = lift . Attoparsec.takeWhile1
91
takeWhile1 = lift . Attoparsec.takeWhile1
41
false
true
0
7
12
31
16
15
null
null
tmcgilchrist/riak-haskell-client
protobuf/src/Network/Riak/Protocol/MapField/MapFieldType.hs
apache-2.0
toMaybe'Enum _ = Prelude'.Nothing
33
toMaybe'Enum _ = Prelude'.Nothing
33
toMaybe'Enum _ = Prelude'.Nothing
33
false
false
0
5
3
11
5
6
null
null
dblia/nosql-ganeti
src/Ganeti/Query/Query.hs
gpl-2.0
queryFields (QueryFields (ItemTypeLuxi QRJob) fields) = Ok $ fieldsExtractor Query.Job.fieldsMap fields
105
queryFields (QueryFields (ItemTypeLuxi QRJob) fields) = Ok $ fieldsExtractor Query.Job.fieldsMap fields
105
queryFields (QueryFields (ItemTypeLuxi QRJob) fields) = Ok $ fieldsExtractor Query.Job.fieldsMap fields
105
false
false
2
9
12
36
17
19
null
null
ducis/haAni
hs/common/Graphics/Rendering/OpenGL/GL/Colors.hs
gpl-2.0
-------------------------------------------------------------------------------- lighting :: StateVar Capability lighting = makeCapability CapLighting
151
lighting :: StateVar Capability lighting = makeCapability CapLighting
69
lighting = makeCapability CapLighting
37
true
true
0
5
9
18
9
9
null
null
Hodapp87/ivory
ivory-serialize/src/Ivory/Serialize/Struct.hs
bsd-3-clause
packLabel' :: (IvoryStruct sym, IvoryArea t) => Label sym t -> PackRep t -> PackLabel sym packLabel' label rep = PackLabel $ PackRep { packGetLE = \ buf offs str -> packGetLE rep buf offs (str ~> label) , packGetBE = \ buf offs str -> packGetBE rep buf offs (str ~> label) , packSetLE = \ buf offs str -> packSetLE...
452
packLabel' :: (IvoryStruct sym, IvoryArea t) => Label sym t -> PackRep t -> PackLabel sym packLabel' label rep = PackLabel $ PackRep { packGetLE = \ buf offs str -> packGetLE rep buf offs (str ~> label) , packGetBE = \ buf offs str -> packGetBE rep buf offs (str ~> label) , packSetLE = \ buf offs str -> packSetLE...
452
packLabel' label rep = PackLabel $ PackRep { packGetLE = \ buf offs str -> packGetLE rep buf offs (str ~> label) , packGetBE = \ buf offs str -> packGetBE rep buf offs (str ~> label) , packSetLE = \ buf offs str -> packSetLE rep buf offs (str ~> label) , packSetBE = \ buf offs str -> packSetBE rep buf offs (str...
362
false
true
0
11
100
193
101
92
null
null
FranklinChen/hugs98-plus-Sep2006
packages/HaXml/src/Text/ParserCombinators/HuttonMeijerWallace.hs
bsd-3-clause
-- | Fail if end of input is not reached eof :: Show p => Parser s (p,t) String () eof = P (\st inp -> case inp of [] -> Right [((),st,[])] (Left e:_) -> Left e (Right (p,_):_) -> Left ("End of input expected at...
428
eof :: Show p => Parser s (p,t) String () eof = P (\st inp -> case inp of [] -> Right [((),st,[])] (Left e:_) -> Left e (Right (p,_):_) -> Left ("End of input expected at " ...
387
eof = P (\st inp -> case inp of [] -> Right [((),st,[])] (Left e:_) -> Left e (Right (p,_):_) -> Left ("End of input expected at " ++show p++"\n but found text") ...
331
true
true
0
15
235
144
73
71
null
null
karshan/syz
Data/Generics/Zipper.hs
bsd-3-clause
fromLeft :: Left r -> r fromLeft (LeftUnit a) = a
51
fromLeft :: Left r -> r fromLeft (LeftUnit a) = a
51
fromLeft (LeftUnit a) = a
27
false
true
0
9
12
33
14
19
null
null
plow-technologies/template-service
master/src/Data/Master/Template.hs
bsd-3-clause
templateFixNormalized :: L.Iso' (TemplateFix Normalized level a) (Template Normalized level a) templateFixNormalized = L.iso unFixLevel FixLevel
144
templateFixNormalized :: L.Iso' (TemplateFix Normalized level a) (Template Normalized level a) templateFixNormalized = L.iso unFixLevel FixLevel
144
templateFixNormalized = L.iso unFixLevel FixLevel
49
false
true
0
7
15
45
22
23
null
null
tittoassini/flat
test/Core.hs
bsd-3-clause
s4 :: NumBits s4 = size E4_1 0
30
s4 :: NumBits s4 = size E4_1 0
30
s4 = size E4_1 0
16
false
true
0
6
7
24
9
15
null
null
SimSaladin/animu-watch
src/Animu.hs
bsd-3-clause
syncIn Nyaa = nyaaSync
29
syncIn Nyaa = nyaaSync
29
syncIn Nyaa = nyaaSync
29
false
false
0
5
10
9
4
5
null
null
guibou/AdventOfCode2016
src/AsmBunny.hs
bsd-3-clause
inc = (P.string "inc" $> Inc) <*> parseRegister
47
inc = (P.string "inc" $> Inc) <*> parseRegister
47
inc = (P.string "inc" $> Inc) <*> parseRegister
47
false
false
1
9
7
26
11
15
null
null
wuest/haskell-extralife-api
src/Web/ExtraLife/API.hs
bsd-3-clause
userInfo' :: Int -> Request userInfo' = parseRequest_ . userInfoRaw
67
userInfo' :: Int -> Request userInfo' = parseRequest_ . userInfoRaw
67
userInfo' = parseRequest_ . userInfoRaw
39
false
true
0
7
9
26
11
15
null
null
mlite/hLLVM
src/Llvm/Asm/Simplification.hs
bsd-3-clause
rnDefLocalId x = return x
25
rnDefLocalId x = return x
25
rnDefLocalId x = return x
25
false
false
1
5
4
16
5
11
null
null
svenssonjoel/MonadObsidian
Obsidian/MonadObsidian/Exp.hs
bsd-3-clause
{- LIFTS ETC-} typ1 f (E a) = E (f a)
39
typ1 f (E a) = E (f a)
22
typ1 f (E a) = E (f a)
22
true
false
0
7
12
27
13
14
null
null
nshepperd/funn
Testing/opencl.hs
mit
-- Buffer properties. prop_Buffer_fromList :: Property prop_Buffer_fromList = monadic clProperty $ do xs <- pick (arbitrary :: Gen [Double]) buf <- lift $ Buffer.fromList xs ys <- lift $ Buffer.toList buf assert (xs == ys)
231
prop_Buffer_fromList :: Property prop_Buffer_fromList = monadic clProperty $ do xs <- pick (arbitrary :: Gen [Double]) buf <- lift $ Buffer.fromList xs ys <- lift $ Buffer.toList buf assert (xs == ys)
208
prop_Buffer_fromList = monadic clProperty $ do xs <- pick (arbitrary :: Gen [Double]) buf <- lift $ Buffer.fromList xs ys <- lift $ Buffer.toList buf assert (xs == ys)
175
true
true
0
12
43
86
41
45
null
null
nikita-volkov/wobsurv
library/Wobsurv/Util/HTTP/Parser.hs
mit
unknownHeader :: Parser UnknownHeader unknownHeader = labeling "unknownHeader" $ (,) <$> (key <* char ':' <* skipSpace) <*> value <* endOfLine where key = takeWhile1 (\c -> isAlphaNum c || c == '-') value = takeWhile1 (/= '\n')
243
unknownHeader :: Parser UnknownHeader unknownHeader = labeling "unknownHeader" $ (,) <$> (key <* char ':' <* skipSpace) <*> value <* endOfLine where key = takeWhile1 (\c -> isAlphaNum c || c == '-') value = takeWhile1 (/= '\n')
243
unknownHeader = labeling "unknownHeader" $ (,) <$> (key <* char ':' <* skipSpace) <*> value <* endOfLine where key = takeWhile1 (\c -> isAlphaNum c || c == '-') value = takeWhile1 (/= '\n')
205
false
true
5
10
53
102
47
55
null
null
elitak/forest
Language/Forest/Generic.hs
epl-1.0
listNonEmptyFiles :: (ForestMD md) => md -> [FilePath] listNonEmptyFiles md = L.filter (\s->s/= "") (listFiles md)
115
listNonEmptyFiles :: (ForestMD md) => md -> [FilePath] listNonEmptyFiles md = L.filter (\s->s/= "") (listFiles md)
114
listNonEmptyFiles md = L.filter (\s->s/= "") (listFiles md)
59
false
true
0
8
16
55
29
26
null
null
vwwv/easy-bitcoin
Network/EasyBitcoin/Internal/Transaction.hs
bsd-3-clause
updateIndex::Int -> [a] -> (a->a) -> [a] updateIndex i xs f | i < 0 || i >= length xs = xs | otherwise = l ++ (f h : r) where (l,h:r) = splitAt i xs -- | Encodes a 'SigHash' to a 32 bit-long bytestring.
249
updateIndex::Int -> [a] -> (a->a) -> [a] updateIndex i xs f | i < 0 || i >= length xs = xs | otherwise = l ++ (f h : r) where (l,h:r) = splitAt i xs -- | Encodes a 'SigHash' to a 32 bit-long bytestring.
249
updateIndex i xs f | i < 0 || i >= length xs = xs | otherwise = l ++ (f h : r) where (l,h:r) = splitAt i xs -- | Encodes a 'SigHash' to a 32 bit-long bytestring.
208
false
true
0
10
93
111
56
55
null
null
ezyang/ghc
compiler/cmm/Hoopl/Block.hs
bsd-3-clause
blockFromList :: [n O O] -> Block n O O blockFromList = foldr BCons BNil
72
blockFromList :: [n O O] -> Block n O O blockFromList = foldr BCons BNil
72
blockFromList = foldr BCons BNil
32
false
true
0
8
14
42
18
24
null
null
jgm/pandoc-citeproc
src/Text/CSL/Output/Pandoc.hs
bsd-3-clause
flipFlop' st (SmallCaps ils) = (if inSmallCaps st then Span ("",["csl-no-smallcaps"],[]) else SmallCaps) $ map (flipFlop' st{ inSmallCaps = not $ inSmallCaps st }) ils
171
flipFlop' st (SmallCaps ils) = (if inSmallCaps st then Span ("",["csl-no-smallcaps"],[]) else SmallCaps) $ map (flipFlop' st{ inSmallCaps = not $ inSmallCaps st }) ils
171
flipFlop' st (SmallCaps ils) = (if inSmallCaps st then Span ("",["csl-no-smallcaps"],[]) else SmallCaps) $ map (flipFlop' st{ inSmallCaps = not $ inSmallCaps st }) ils
171
false
false
2
11
28
79
41
38
null
null
transient-haskell/transient-universe
src/Transient/Move/Services/Executor.hs
mit
-- | execute a command in some node by an executor service, and return the result when the program finishes networkExecute :: String -> String -> Cloud String networkExecute cmdline input= callService executorService (cmdline, input,())
249
networkExecute :: String -> String -> Cloud String networkExecute cmdline input= callService executorService (cmdline, input,())
139
networkExecute cmdline input= callService executorService (cmdline, input,())
86
true
true
0
7
47
44
23
21
null
null
wayofthepie/sip
src/Linux/Parser/Internal/Common.hs
mit
- | Parse and integer intp :: Parser ByteString intp = takeWhile $ inClass "0-9"
81
intp :: Parser ByteString intp = takeWhile $ inClass "0-9"
58
intp = takeWhile $ inClass "0-9"
32
true
true
3
6
15
40
16
24
null
null
Risto-Stevcev/haskell-church-encodings
RankNTypes/TestChurch.hs
bsd-3-clause
tests_integers = TestList [TestLabel "convertNZ zero" test_convertNZ_zero, TestLabel "convertNZ three" test_convertNZ_three, TestLabel "convertNZ 45" test_convertNZ_45, TestLabel "neg 0" test_neg_zero, TestLabel "neg 27" test_neg_27]
284
tests_integers = TestList [TestLabel "convertNZ zero" test_convertNZ_zero, TestLabel "convertNZ three" test_convertNZ_three, TestLabel "convertNZ 45" test_convertNZ_45, TestLabel "neg 0" test_neg_zero, TestLabel "neg 27" test_neg_27]
284
tests_integers = TestList [TestLabel "convertNZ zero" test_convertNZ_zero, TestLabel "convertNZ three" test_convertNZ_three, TestLabel "convertNZ 45" test_convertNZ_45, TestLabel "neg 0" test_neg_zero, TestLabel "neg 27" test_neg_27]
284
false
false
0
7
73
49
24
25
null
null
chadbrewbaker/combinat
Math/Combinat/Helper.hs
bsd-3-clause
istogram :: (Eq a, Ord a) => [a] -> [(a,Int)] histogram xs = Map.toList table where table = Map.fromListWith (+) [ (x,1) | x<-xs ] -------------------------------------------------------------------------------- -- * maybe
227
histogram :: (Eq a, Ord a) => [a] -> [(a,Int)] histogram xs = Map.toList table where table = Map.fromListWith (+) [ (x,1) | x<-xs ] -------------------------------------------------------------------------------- -- * maybe
227
histogram xs = Map.toList table where table = Map.fromListWith (+) [ (x,1) | x<-xs ] -------------------------------------------------------------------------------- -- * maybe
180
false
true
0
10
33
85
48
37
null
null
sdiehl/ghc
compiler/types/CoAxiom.hs
bsd-3-clause
coAxBranchIncomps :: CoAxBranch -> [CoAxBranch] coAxBranchIncomps = cab_incomps
79
coAxBranchIncomps :: CoAxBranch -> [CoAxBranch] coAxBranchIncomps = cab_incomps
79
coAxBranchIncomps = cab_incomps
31
false
true
0
6
7
18
10
8
null
null
alexbiehl/postie
src/Network/Mail/Postie.hs
bsd-3-clause
run :: Int -> Application -> IO () run port = runSettings (def {settingsPort = fromIntegral port})
98
run :: Int -> Application -> IO () run port = runSettings (def {settingsPort = fromIntegral port})
98
run port = runSettings (def {settingsPort = fromIntegral port})
63
false
true
0
9
16
47
23
24
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
solicitously = id
17
solicitously = id
17
solicitously = id
17
false
false
0
4
2
6
3
3
null
null
mbakke/ganeti
src/Ganeti/Query/Instance.hs
bsd-2-clause
-- | Checks if the primary node of an instance is offline isPrimaryOffline :: ConfigData -> Instance -> Bool isPrimaryOffline cfg inst = let pNodeResult = maybe (Bad $ ParameterError "no primary node") return (instPrimaryNode inst) >>= getNode cfg in case pNodeResult of...
486
isPrimaryOffline :: ConfigData -> Instance -> Bool isPrimaryOffline cfg inst = let pNodeResult = maybe (Bad $ ParameterError "no primary node") return (instPrimaryNode inst) >>= getNode cfg in case pNodeResult of Ok pNode -> nodeOffline pNode Bad _ -> error...
428
isPrimaryOffline cfg inst = let pNodeResult = maybe (Bad $ ParameterError "no primary node") return (instPrimaryNode inst) >>= getNode cfg in case pNodeResult of Ok pNode -> nodeOffline pNode Bad _ -> error "Programmer error - result assumed to be OK is Bad...
377
true
true
0
13
134
95
45
50
null
null
lennart/Tidal-Trigger
Sound/Tidal/Trigger.hs
gpl-3.0
normMIDIRange :: (Integral a, Fractional b) => a -> b normMIDIRange a = (fromIntegral a) / 127
94
normMIDIRange :: (Integral a, Fractional b) => a -> b normMIDIRange a = (fromIntegral a) / 127
94
normMIDIRange a = (fromIntegral a) / 127
40
false
true
0
7
16
43
22
21
null
null
spechub/Hets
Comorphisms/SoftFOL2CommonLogic.hs
gpl-2.0
mapSentence :: FOLSign.Sign -> FOLSign.Sentence -> Result TEXT_META mapSentence = translate
91
mapSentence :: FOLSign.Sign -> FOLSign.Sentence -> Result TEXT_META mapSentence = translate
91
mapSentence = translate
23
false
true
0
7
10
26
13
13
null
null
joelmccracken/git-stuff
src/Handler/Git.hs
bsd-3-clause
errorNotGitRepo :: GitRepoTrackable -> R.Reddup () errorNotGitRepo (GitRepoTrackable dir _locSpec) = do liftIO $ putStrLn $ "Warning: Not a git repository: " <> Tu.encodeString dir
182
errorNotGitRepo :: GitRepoTrackable -> R.Reddup () errorNotGitRepo (GitRepoTrackable dir _locSpec) = do liftIO $ putStrLn $ "Warning: Not a git repository: " <> Tu.encodeString dir
182
errorNotGitRepo (GitRepoTrackable dir _locSpec) = do liftIO $ putStrLn $ "Warning: Not a git repository: " <> Tu.encodeString dir
131
false
true
0
9
26
57
26
31
null
null
Catchouli/robo
src/HTTP.hs
bsd-3-clause
-- | Download like with simpleHttp, but using an existing manager for the task simpleHttpWithManager :: Manager -> String -> IO String simpleHttpWithManager manager url = do url' <- parseUrl url fmap (LB.unpack . responseBody) $ httpLbs url' manager
288
simpleHttpWithManager :: Manager -> String -> IO String simpleHttpWithManager manager url = do url' <- parseUrl url fmap (LB.unpack . responseBody) $ httpLbs url' manager
209
simpleHttpWithManager manager url = do url' <- parseUrl url fmap (LB.unpack . responseBody) $ httpLbs url' manager
153
true
true
0
12
77
67
30
37
null
null
junjihashimoto/hsverilog
tests/test.hs
bsd-3-clause
trimSpace (' ':'@':xs) = trimSpace ('@':xs)
43
trimSpace (' ':'@':xs) = trimSpace ('@':xs)
43
trimSpace (' ':'@':xs) = trimSpace ('@':xs)
43
false
false
0
7
5
31
15
16
null
null
josefs/autosar
ARSim/arsim/AUTOSAR/ARSim.hs
bsd-3-clause
hear conn label proc = Unchanged
69
hear conn label proc = Unchanged
69
hear conn label proc = Unchanged
69
false
false
0
5
42
15
6
9
null
null
Javran/Project-Euler
src/ProjectEuler/Problem95.hs
mit
result :: Int result = IS.findMin $ head sortedLoopGroups where -- sort by descending group size to find the maximum sortedLoopGroups = sortOn (Down . IS.size) loopGroups loopGroups :: [IS.IntSet] loopGroups = unfoldr go loopMapInit go loopMap = if IS.null grp then Nothing el...
401
result :: Int result = IS.findMin $ head sortedLoopGroups where -- sort by descending group size to find the maximum sortedLoopGroups = sortOn (Down . IS.size) loopGroups loopGroups :: [IS.IntSet] loopGroups = unfoldr go loopMapInit go loopMap = if IS.null grp then Nothing el...
401
result = IS.findMin $ head sortedLoopGroups where -- sort by descending group size to find the maximum sortedLoopGroups = sortOn (Down . IS.size) loopGroups loopGroups :: [IS.IntSet] loopGroups = unfoldr go loopMapInit go loopMap = if IS.null grp then Nothing else Just (grp, ...
387
false
true
0
8
110
110
58
52
null
null
bjpop/haskell-linux-perf
ghc-events-perf/ghc-events-perf.hs
bsd-3-clause
-- Exit the program with an error message. die :: String -> IO a die s = hPutStrLn stderr s >> exitWith (ExitFailure 1)
119
die :: String -> IO a die s = hPutStrLn stderr s >> exitWith (ExitFailure 1)
76
die s = hPutStrLn stderr s >> exitWith (ExitFailure 1)
54
true
true
0
8
23
45
20
25
null
null
samplecount/shake-ci
src/Development/Shake/CI/Slack.hs
apache-2.0
-- | Post a text message to a slack channel. -- -- SLACK_URL environment variable needs to be defined. slack :: Message -> Action () slack = liftIO . slackIO
157
slack :: Message -> Action () slack = liftIO . slackIO
54
slack = liftIO . slackIO
24
true
true
0
8
29
33
16
17
null
null
mattneary/tux
src/System/Tmux.hs
mit
windowNoun :: WindowId -> String windowNoun (s, w) = s ++ ":" ++ (show w)
73
windowNoun :: WindowId -> String windowNoun (s, w) = s ++ ":" ++ (show w)
73
windowNoun (s, w) = s ++ ":" ++ (show w)
40
false
true
2
8
14
44
21
23
null
null
travitch/llvm-base-types
src/Data/LLVM/Internal/Printers.hs
bsd-3-clause
printValue :: Value -> Builder printValue v = case valueContent v of FunctionC f -> let retAttrS = unwords $ map show (functionRetAttrs f) argS = commaSep $ map (printValue . toValue) (functionParameters f) fAttrS = spaceSep $ map fromShow (functionAttrs f) bodyS = lineSep $ map (printValu...
15,980
printValue :: Value -> Builder printValue v = case valueContent v of FunctionC f -> let retAttrS = unwords $ map show (functionRetAttrs f) argS = commaSep $ map (printValue . toValue) (functionParameters f) fAttrS = spaceSep $ map fromShow (functionAttrs f) bodyS = lineSep $ map (printValu...
15,980
printValue v = case valueContent v of FunctionC f -> let retAttrS = unwords $ map show (functionRetAttrs f) argS = commaSep $ map (printValue . toValue) (functionParameters f) fAttrS = spaceSep $ map fromShow (functionAttrs f) bodyS = lineSep $ map (printValue . toValue) (functionBody f) ...
15,949
false
true
6
22
6,491
3,543
1,818
1,725
null
null
forked-upstream-packages-for-ghcjs/ghcjs
ghcjs/src/Gen2/Prim.hs
mit
genPrim _ _ Ctz8Op [r] [x] = PrimInline [j| `r` = h$ctz8(`x`); |]
104
genPrim _ _ Ctz8Op [r] [x] = PrimInline [j| `r` = h$ctz8(`x`); |]
104
genPrim _ _ Ctz8Op [r] [x] = PrimInline [j| `r` = h$ctz8(`x`); |]
104
false
false
0
6
51
30
17
13
null
null
sergv/tags-server
src/Haskell/Language/LexerSimple/Types.hs
bsd-3-clause
litLocToInt :: LiterateLocation LiterateStyle -> Int litLocToInt = \case Vanilla -> 0 LiterateOutside -> 1 LiterateInside Bird -> 2 LiterateInside Latex -> 3
186
litLocToInt :: LiterateLocation LiterateStyle -> Int litLocToInt = \case Vanilla -> 0 LiterateOutside -> 1 LiterateInside Bird -> 2 LiterateInside Latex -> 3
186
litLocToInt = \case Vanilla -> 0 LiterateOutside -> 1 LiterateInside Bird -> 2 LiterateInside Latex -> 3
133
false
true
0
8
51
56
25
31
null
null
ndmitchell/qed
v1/Simplify.hs
bsd-3-clause
count :: Var -> Exp -> Int count v (Var x) = if v == x then 1 else 0
68
count :: Var -> Exp -> Int count v (Var x) = if v == x then 1 else 0
68
count v (Var x) = if v == x then 1 else 0
41
false
true
0
7
19
42
22
20
null
null
jyp/ControlledFusion
Control/Fusion/List/Nu.hs
gpl-3.0
takeNu :: Int -> NuList a -> NuList a takeNu n0 (Unfold s0 psi) = Unfold (n0,s0) (uncurry go) where go 0 _ = Done go n s = case psi s of Done -> Done Yield x t -> Yield x (n-1,t)
192
takeNu :: Int -> NuList a -> NuList a takeNu n0 (Unfold s0 psi) = Unfold (n0,s0) (uncurry go) where go 0 _ = Done go n s = case psi s of Done -> Done Yield x t -> Yield x (n-1,t)
192
takeNu n0 (Unfold s0 psi) = Unfold (n0,s0) (uncurry go) where go 0 _ = Done go n s = case psi s of Done -> Done Yield x t -> Yield x (n-1,t)
154
false
true
0
10
56
115
57
58
null
null
pparkkin/eta
compiler/ETA/Utils/UniqDSet.hs
bsd-3-clause
mkUniqDSet :: Uniquable a => [a] -> UniqDSet a mkUniqDSet = foldl addOneToUniqDSet emptyUniqDSet
97
mkUniqDSet :: Uniquable a => [a] -> UniqDSet a mkUniqDSet = foldl addOneToUniqDSet emptyUniqDSet
97
mkUniqDSet = foldl addOneToUniqDSet emptyUniqDSet
49
false
true
0
8
14
39
17
22
null
null
rad1al/hutton_exercises
notes_ch12.hs
gpl-2.0
{- fmap0 :: a -> f a fmap1 :: (a -> b) -> f a -> f b fmap2 :: (a -> b -> c) -> f a -> f b -> f c fmap3 :: (a -> b -> c -> d) -> f a -> f b -> f c -> f d ------------------------------------------------------- pure :: a -> f a (<*>) :: f (a -> b) -> f a -> f b > :t pure pure :: Applicative f => a -> f a > :t (<...
1,954
prods :: [Int] -> [Int] -> [Int] prods xs ys = [x*y | x <- xs, y <- ys]
71
prods xs ys = [x*y | x <- xs, y <- ys]
38
true
true
0
9
543
64
33
31
null
null
rodrigogribeiro/mptc
src/Utils/Env.hs
bsd-3-clause
-- a map over an environment mapEnv :: (a -> b) -> Env a -> Env b mapEnv f = Map.map f
87
mapEnv :: (a -> b) -> Env a -> Env b mapEnv f = Map.map f
57
mapEnv f = Map.map f
20
true
true
0
7
22
41
20
21
null
null
lukexi/ghc-7.8-arm64
compiler/main/DriverMkDepend.hs
bsd-3-clause
processDeps dflags hsc_env excl_mods root hdl (AcyclicSCC node) = do { let extra_suffixes = depSuffixes dflags include_pkg_deps = depIncludePkgDeps dflags src_file = msHsFilePath node obj_file = msObjFilePath node obj_files = insertSuffixes obj_file extra_suf...
1,646
processDeps dflags hsc_env excl_mods root hdl (AcyclicSCC node) = do { let extra_suffixes = depSuffixes dflags include_pkg_deps = depIncludePkgDeps dflags src_file = msHsFilePath node obj_file = msObjFilePath node obj_files = insertSuffixes obj_file extra_suf...
1,646
processDeps dflags hsc_env excl_mods root hdl (AcyclicSCC node) = do { let extra_suffixes = depSuffixes dflags include_pkg_deps = depIncludePkgDeps dflags src_file = msHsFilePath node obj_file = msObjFilePath node obj_files = insertSuffixes obj_file extra_suf...
1,646
false
false
0
21
740
327
166
161
null
null
haraldsteinlechner/lambdaWolf
src/Sg2Support.hs
gpl-3.0
composeSF :: RenderSF -> RenderSF -> RenderSF composeSF = undefined
68
composeSF :: RenderSF -> RenderSF -> RenderSF composeSF = undefined
67
composeSF = undefined
21
false
true
0
8
10
26
11
15
null
null
seanparsons/app-base
src/Entities.hs
bsd-3-clause
upperFirstLetter :: String -> String upperFirstLetter [] = []
69
upperFirstLetter :: String -> String upperFirstLetter [] = []
69
upperFirstLetter [] = []
32
false
true
0
6
16
22
11
11
null
null
takoeight0821/malgo
src/Malgo/Parser.hs
bsd-3-clause
pWith' :: Parser (Stmt (Malgo 'Parse)) pWith' = do void $ pKeyword "with" pos <- getSourcePos With pos Nothing <$> pExp
125
pWith' :: Parser (Stmt (Malgo 'Parse)) pWith' = do void $ pKeyword "with" pos <- getSourcePos With pos Nothing <$> pExp
125
pWith' = do void $ pKeyword "with" pos <- getSourcePos With pos Nothing <$> pExp
86
false
true
0
11
26
63
27
36
null
null
keithodulaigh/Hets
Taxonomy/AbstractGraphView.hs
gpl-2.0
shownodes gid ((d, (tp, name)) : list) gv = do (gs, _) <- readIORef gv -- try to add the first node writeIORef gv (gs, d) nd@(Result _ error') <- addnode gid tp name gv case error' of Nothing -> -- try to add the rest shownodes gid list gv Just _ -> return nd -- adds edges that had been hidden
319
shownodes gid ((d, (tp, name)) : list) gv = do (gs, _) <- readIORef gv -- try to add the first node writeIORef gv (gs, d) nd@(Result _ error') <- addnode gid tp name gv case error' of Nothing -> -- try to add the rest shownodes gid list gv Just _ -> return nd -- adds edges that had been hidden
319
shownodes gid ((d, (tp, name)) : list) gv = do (gs, _) <- readIORef gv -- try to add the first node writeIORef gv (gs, d) nd@(Result _ error') <- addnode gid tp name gv case error' of Nothing -> -- try to add the rest shownodes gid list gv Just _ -> return nd -- adds edges that had been hidden
319
false
false
0
10
86
124
63
61
null
null
yiannist/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- | Key for job IDs in opcode result jobIdsKey :: String jobIdsKey = "jobs"
76
jobIdsKey :: String jobIdsKey = "jobs"
38
jobIdsKey = "jobs"
18
true
true
0
4
14
12
7
5
null
null
andorp/file-persist
src/Database/Persist/File/Base.hs
bsd-3-clause
persistUpdate assign add substract multiply divide p = case p of Assign -> assign Add -> add Subtract -> substract Multiply -> multiply Divide -> divide
193
persistUpdate assign add substract multiply divide p = case p of Assign -> assign Add -> add Subtract -> substract Multiply -> multiply Divide -> divide
193
persistUpdate assign add substract multiply divide p = case p of Assign -> assign Add -> add Subtract -> substract Multiply -> multiply Divide -> divide
193
false
false
1
8
66
62
26
36
null
null
cglazner/ibd_particle
src/Main.hs
bsd-3-clause
cmdLineCheck :: [a] -> a cmdLineCheck x = case x of [] -> error "No .par file specified on command line." (x:_) -> x
158
cmdLineCheck :: [a] -> a cmdLineCheck x = case x of [] -> error "No .par file specified on command line." (x:_) -> x
158
cmdLineCheck x = case x of [] -> error "No .par file specified on command line." (x:_) -> x
133
false
true
0
9
65
49
25
24
null
null
trianglesphere/hcas
src/Floating.hs
agpl-3.0
sinNth :: Integral a => Ratio a -> a -> Ratio a sinNth x n = (alt n) * (x ^ (2*n + 1)) / (factorial (2*n + 1) % 1)
114
sinNth :: Integral a => Ratio a -> a -> Ratio a sinNth x n = (alt n) * (x ^ (2*n + 1)) / (factorial (2*n + 1) % 1)
114
sinNth x n = (alt n) * (x ^ (2*n + 1)) / (factorial (2*n + 1) % 1)
66
false
true
1
12
30
96
46
50
null
null
AndrewRademacher/poker
src/Poker/Deal.hs
mit
runPokerT :: [Card] -> PokerT m a -> m (a, [Card]) runPokerT s = flip runStateT s . unPokerT
92
runPokerT :: [Card] -> PokerT m a -> m (a, [Card]) runPokerT s = flip runStateT s . unPokerT
92
runPokerT s = flip runStateT s . unPokerT
41
false
true
0
9
18
51
26
25
null
null
andrewMacmurray/haskell-book-solutions
src/ch15/MadLibs.hs
mit
madlib :: Exclamation -> Adverb -> Noun -> Adjective -> String madlib e adv noun adj = e <> "! he said " <> adv <> " as he jumped into his car " <> noun <> " and drove off with his " <> adj <> " wife."
209
madlib :: Exclamation -> Adverb -> Noun -> Adjective -> String madlib e adv noun adj = e <> "! he said " <> adv <> " as he jumped into his car " <> noun <> " and drove off with his " <> adj <> " wife."
209
madlib e adv noun adj = e <> "! he said " <> adv <> " as he jumped into his car " <> noun <> " and drove off with his " <> adj <> " wife."
146
false
true
0
11
56
64
32
32
null
null
vadimvinnik/multi-trie
tests/MultiTrieTest.hs
mit
test_mtmap = do assertEqual v (map f u) assertEqual w (mapWithName g u) where u = fromList p :: TestMultiTrie v = fromList q w = fromList r p = [("", 1), ("abc", 2), ("a", 3), ("", 4), ("ab", 5), ("b", 6), ("bc", 7)] q = L.map (\(n, x) -> (...
495
test_mtmap = do assertEqual v (map f u) assertEqual w (mapWithName g u) where u = fromList p :: TestMultiTrie v = fromList q w = fromList r p = [("", 1), ("abc", 2), ("a", 3), ("", 4), ("ab", 5), ("b", 6), ("bc", 7)] q = L.map (\(n, x) -> (...
495
test_mtmap = do assertEqual v (map f u) assertEqual w (mapWithName g u) where u = fromList p :: TestMultiTrie v = fromList q w = fromList r p = [("", 1), ("abc", 2), ("a", 3), ("", 4), ("ab", 5), ("b", 6), ("bc", 7)] q = L.map (\(n, x) -> (...
495
false
false
0
11
191
251
143
108
null
null
seereason/ghcjs
src/Gen2/Prim.hs
mit
genPrim _ _ Clz64Op [r] [x1,x2] = PrimInline [j| `r` = h$clz64(`x1`,`x2`); |]
104
genPrim _ _ Clz64Op [r] [x1,x2] = PrimInline [j| `r` = h$clz64(`x1`,`x2`); |]
104
genPrim _ _ Clz64Op [r] [x1,x2] = PrimInline [j| `r` = h$clz64(`x1`,`x2`); |]
104
false
false
0
6
39
33
19
14
null
null
jystic/QuickSpec
experiment/Monomorphise.hs
bsd-3-clause
con'' :: Q Exp -> Q Exp con'' t = do name <- fmap (nameBase . expName) t [| con name $t |]
94
con'' :: Q Exp -> Q Exp con'' t = do name <- fmap (nameBase . expName) t [| con name $t |]
94
con'' t = do name <- fmap (nameBase . expName) t [| con name $t |]
70
false
true
0
10
26
49
24
25
null
null
fhaust/aer-utils
src/Data/AER/MotionFlow.hs
mit
f <$$> x = fmap (fmap f) x
26
f <$$> x = fmap (fmap f) x
26
f <$$> x = fmap (fmap f) x
26
false
false
2
7
7
22
10
12
null
null
travitch/llvm-base-types
src/Data/LLVM/Internal/ForceModule.hs
bsd-3-clause
forceMetadataT m@(MetaDWCompileUnit {}) = do mapM_ maybeMetaForceIfNeeded $ metaCompileUnitEnumTypes m mapM_ maybeMetaForceIfNeeded $ metaCompileUnitRetainedTypes m mapM_ maybeMetaForceIfNeeded $ metaCompileUnitSubprograms m mapM_ maybeMetaForceIfNeeded $ metaCompileUnitGlobalVariables m metaCompileUnitSource...
449
forceMetadataT m@(MetaDWCompileUnit {}) = do mapM_ maybeMetaForceIfNeeded $ metaCompileUnitEnumTypes m mapM_ maybeMetaForceIfNeeded $ metaCompileUnitRetainedTypes m mapM_ maybeMetaForceIfNeeded $ metaCompileUnitSubprograms m mapM_ maybeMetaForceIfNeeded $ metaCompileUnitGlobalVariables m metaCompileUnitSource...
449
forceMetadataT m@(MetaDWCompileUnit {}) = do mapM_ maybeMetaForceIfNeeded $ metaCompileUnitEnumTypes m mapM_ maybeMetaForceIfNeeded $ metaCompileUnitRetainedTypes m mapM_ maybeMetaForceIfNeeded $ metaCompileUnitSubprograms m mapM_ maybeMetaForceIfNeeded $ metaCompileUnitGlobalVariables m metaCompileUnitSource...
449
false
false
2
13
54
125
57
68
null
null
janschulz/pandoc
src/Text/Pandoc/Writers/Man.hs
gpl-2.0
-- | Return man representation of a note. noteToMan :: WriterOptions -> Int -> [Block] -> State WriterState Doc noteToMan opts num note = do contents <- blockListToMan opts note let marker = cr <> text ".SS " <> brackets (text (show num)) return $ marker $$ contents -- | Association list of characters to escape.
320
noteToMan :: WriterOptions -> Int -> [Block] -> State WriterState Doc noteToMan opts num note = do contents <- blockListToMan opts note let marker = cr <> text ".SS " <> brackets (text (show num)) return $ marker $$ contents -- | Association list of characters to escape.
278
noteToMan opts num note = do contents <- blockListToMan opts note let marker = cr <> text ".SS " <> brackets (text (show num)) return $ marker $$ contents -- | Association list of characters to escape.
208
true
true
0
15
62
103
48
55
null
null
jmn/goodreads
app/Main.hs
bsd-3-clause
parseShowFollowers :: Parser Command parseShowFollowers = ShowFollowers <$> argument auto (metavar "GOODREADS_USER_ID" <> value 0)
134
parseShowFollowers :: Parser Command parseShowFollowers = ShowFollowers <$> argument auto (metavar "GOODREADS_USER_ID" <> value 0)
134
parseShowFollowers = ShowFollowers <$> argument auto (metavar "GOODREADS_USER_ID" <> value 0)
97
false
true
2
8
18
37
17
20
null
null
JacquesCarette/literate-scientific-software
code/drasil-code/Language/Drasil/Code/ExtLibImport.hs
bsd-2-clause
genArgumentInfos [] [] = return []
34
genArgumentInfos [] [] = return []
34
genArgumentInfos [] [] = return []
34
false
false
1
6
5
24
9
15
null
null
siddhanathan/ghc
includes/CodeGen.Platform.hs
bsd-3-clause
callerSaves (VanillaReg 1 _) = True
36
callerSaves (VanillaReg 1 _) = True
36
callerSaves (VanillaReg 1 _) = True
36
false
false
0
7
6
17
8
9
null
null
goldfirere/th-desugar
Language/Haskell/TH/Desugar/Match.hs
bsd-3-clause
scExp e@(DConE {}) = return e
29
scExp e@(DConE {}) = return e
29
scExp e@(DConE {}) = return e
29
false
false
0
7
5
23
11
12
null
null
merc1031/haskell-sonos-http-api
externals/test-preproc/Main.hs
bsd-3-clause
putTogether :: String -> String putTogether = ("import qualified " ++)
70
putTogether :: String -> String putTogether = ("import qualified " ++)
70
putTogether = ("import qualified " ++)
38
false
true
0
5
10
19
11
8
null
null
msakai/multiset-large
Data/IntMultiSet/Large.hs
bsd-3-clause
-- | /O(n*min(n,W))/. Create a multiset from a list of element\/occurence pairs. fromOccurList :: [(Int,Occur)] -> IntMultiSet fromOccurList = MS . Map.fromListWith (+)
169
fromOccurList :: [(Int,Occur)] -> IntMultiSet fromOccurList = MS . Map.fromListWith (+)
87
fromOccurList = MS . Map.fromListWith (+)
41
true
true
0
7
23
36
21
15
null
null
nevrenato/HetsAlloy
Maude/Sign.hs
gpl-2.0
kindRelList l@(s : _) r m = kindRelList not_rel r m' where (top : _) = List.sort $ getTop r s tc = Rel.transClosure r (rel, not_rel) = sameKindList s tc l f x y = Map.insert y (sortSym2kindSym x) m' = foldr (f top) m rel
274
kindRelList l@(s : _) r m = kindRelList not_rel r m' where (top : _) = List.sort $ getTop r s tc = Rel.transClosure r (rel, not_rel) = sameKindList s tc l f x y = Map.insert y (sortSym2kindSym x) m' = foldr (f top) m rel
274
kindRelList l@(s : _) r m = kindRelList not_rel r m' where (top : _) = List.sort $ getTop r s tc = Rel.transClosure r (rel, not_rel) = sameKindList s tc l f x y = Map.insert y (sortSym2kindSym x) m' = foldr (f top) m rel
274
false
false
4
8
100
124
63
61
null
null
jml/hazard
lib/Hazard/HttpAuth.hs
apache-2.0
maybeLoggedIn :: Request -> Maybe ByteString maybeLoggedIn req = do authHeader <- lookup "Authorization" $ requestHeaders req (u, _) <- extractBasicAuth authHeader return u -- Abstract HTTP authentioation
212
maybeLoggedIn :: Request -> Maybe ByteString maybeLoggedIn req = do authHeader <- lookup "Authorization" $ requestHeaders req (u, _) <- extractBasicAuth authHeader return u -- Abstract HTTP authentioation
212
maybeLoggedIn req = do authHeader <- lookup "Authorization" $ requestHeaders req (u, _) <- extractBasicAuth authHeader return u -- Abstract HTTP authentioation
167
false
true
0
9
35
61
28
33
null
null
myfreeweb/gitson
benchmark/GitsonBench.hs
unlicense
cleanup ∷ IO () cleanup = removeDirectoryRecursive benchRepoPath
64
cleanup ∷ IO () cleanup = removeDirectoryRecursive benchRepoPath
64
cleanup = removeDirectoryRecursive benchRepoPath
48
false
true
0
6
7
19
9
10
null
null
thomie/vector
Data/Vector/Storable.hs
bsd-3-clause
zipWith3 = G.zipWith3
21
zipWith3 = G.zipWith3
21
zipWith3 = G.zipWith3
21
false
false
0
5
2
8
4
4
null
null
ekmett/ghc
compiler/codeGen/StgCmmEnv.hs
bsd-3-clause
getNonVoidArgAmodes (arg:args) | isVoidRep (argPrimRep arg) = getNonVoidArgAmodes args | otherwise = do { amode <- getArgAmode (NonVoid arg) ; amodes <- getNonVoidArgAmodes args ; return ( amode : amodes ) }
252
getNonVoidArgAmodes (arg:args) | isVoidRep (argPrimRep arg) = getNonVoidArgAmodes args | otherwise = do { amode <- getArgAmode (NonVoid arg) ; amodes <- getNonVoidArgAmodes args ; return ( amode : amodes ) }
252
getNonVoidArgAmodes (arg:args) | isVoidRep (argPrimRep arg) = getNonVoidArgAmodes args | otherwise = do { amode <- getArgAmode (NonVoid arg) ; amodes <- getNonVoidArgAmodes args ; return ( amode : amodes ) }
252
false
false
0
12
76
90
41
49
null
null
hjwylde/werewolf
app/Werewolf/Command/Heal.hs
bsd-3-clause
handle :: (MonadIO m, MonadRandom m) => Text -> Text -> m () handle callerName tag = do unlessM (doesGameExist tag) $ exitWith failure { messages = [noGameRunningMessage callerName] } game <- readGame tag let command = healCommand callerName result <- runExceptT . runWriterT $ execSta...
582
handle :: (MonadIO m, MonadRandom m) => Text -> Text -> m () handle callerName tag = do unlessM (doesGameExist tag) $ exitWith failure { messages = [noGameRunningMessage callerName] } game <- readGame tag let command = healCommand callerName result <- runExceptT . runWriterT $ execSta...
582
handle callerName tag = do unlessM (doesGameExist tag) $ exitWith failure { messages = [noGameRunningMessage callerName] } game <- readGame tag let command = healCommand callerName result <- runExceptT . runWriterT $ execStateT (apply command >> checkStage >> checkGameOver) game c...
521
false
true
0
13
140
195
94
101
null
null
alexisVallet/haskell-shmup
QuadTree.hs
bsd-3-clause
subQuadrants :: AABB -> (AABB,AABB,AABB,AABB) subQuadrants (AABB (cx,cy) (hx,hy)) = let newHX = hx/2 newHY = hy/2 newHalfSize = (newHX, newHY) in (AABB (cx-newHX,cy-newHY) newHalfSize, AABB (cx+newHX,cy-newHY) newHalfSize, AABB (cx-newHX,cy+newHY) newHalfSize, AABB (cx+newHX,cy+newHY) newHalf...
325
subQuadrants :: AABB -> (AABB,AABB,AABB,AABB) subQuadrants (AABB (cx,cy) (hx,hy)) = let newHX = hx/2 newHY = hy/2 newHalfSize = (newHX, newHY) in (AABB (cx-newHX,cy-newHY) newHalfSize, AABB (cx+newHX,cy-newHY) newHalfSize, AABB (cx-newHX,cy+newHY) newHalfSize, AABB (cx+newHX,cy+newHY) newHalf...
325
subQuadrants (AABB (cx,cy) (hx,hy)) = let newHX = hx/2 newHY = hy/2 newHalfSize = (newHX, newHY) in (AABB (cx-newHX,cy-newHY) newHalfSize, AABB (cx+newHX,cy-newHY) newHalfSize, AABB (cx-newHX,cy+newHY) newHalfSize, AABB (cx+newHX,cy+newHY) newHalfSize)
279
false
true
0
10
60
173
96
77
null
null
mettekou/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
collectValBinders expr = go [] expr where go ids (Lam b e) | isId b = go (b:ids) e go ids body = (reverse ids, body)
142
collectValBinders expr = go [] expr where go ids (Lam b e) | isId b = go (b:ids) e go ids body = (reverse ids, body)
142
collectValBinders expr = go [] expr where go ids (Lam b e) | isId b = go (b:ids) e go ids body = (reverse ids, body)
142
false
false
2
8
51
89
36
53
null
null
chpatrick/hmidi
examples/SMF.hs
bsd-3-clause
etaevent 0x21 = do { constbyte 1 ; l <- int8 ; return $ MIDIPort l }
72
metaevent 0x21 = do { constbyte 1 ; l <- int8 ; return $ MIDIPort l }
72
metaevent 0x21 = do { constbyte 1 ; l <- int8 ; return $ MIDIPort l }
72
false
false
1
8
20
39
17
22
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/TreeWalker.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker.currentNode Mozilla TreeWalker.currentNode documentation> setCurrentNode :: (MonadDOM m, IsNode val) => TreeWalker -> val -> m () setCurrentNode self val = liftDOM (self ^. jss "currentNode" (toJSVal val))
289
setCurrentNode :: (MonadDOM m, IsNode val) => TreeWalker -> val -> m () setCurrentNode self val = liftDOM (self ^. jss "currentNode" (toJSVal val))
164
setCurrentNode self val = liftDOM (self ^. jss "currentNode" (toJSVal val))
77
true
true
0
10
47
71
34
37
null
null
facebookincubator/duckling
Duckling/Time/AR/Rules.hs
bsd-3-clause
ruleDaysOfWeek :: [Rule] ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Monday" , "(ال)?[اإ]ثنين" ) , ( "Tuesday" , "(ال)?ثلاثاء?" ) , ( "Wednesday", "(ال)?[اأ]ربعاء?" ) , ( "Thursday" , "(ال)?خميس" ) , ( "Friday" , "(ال)?جمع[ةه]" ) , ( "Saturday" , "(ال)?سبت" ) , ( "Sunday" , "(ال)?[...
336
ruleDaysOfWeek :: [Rule] ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Monday" , "(ال)?[اإ]ثنين" ) , ( "Tuesday" , "(ال)?ثلاثاء?" ) , ( "Wednesday", "(ال)?[اأ]ربعاء?" ) , ( "Thursday" , "(ال)?خميس" ) , ( "Friday" , "(ال)?جمع[ةه]" ) , ( "Saturday" , "(ال)?سبت" ) , ( "Sunday" , "(ال)?[...
336
ruleDaysOfWeek = mkRuleDaysOfWeek [ ( "Monday" , "(ال)?[اإ]ثنين" ) , ( "Tuesday" , "(ال)?ثلاثاء?" ) , ( "Wednesday", "(ال)?[اأ]ربعاء?" ) , ( "Thursday" , "(ال)?خميس" ) , ( "Friday" , "(ال)?جمع[ةه]" ) , ( "Saturday" , "(ال)?سبت" ) , ( "Sunday" , "(ال)?[اأ]حد" ) ]
311
false
true
0
6
96
80
51
29
null
null
jeremyong/Yaiba
Yaiba/Map.hs
bsd-3-clause
-- | /O(n)/. Build a map from an ascending list in linear time with a -- combining function for equal keys. -- /The precondition (input list is ascending) is not checked./ -- -- > let f k a1 a2 = (show k) ++ ":" ++ a1 ++ a2 -- > fromAscListWithKey f [(3,"b"), (5,"a"), (5,"b"), (5,"b")] == fromList [(3, "b"), (5, "5:b5:...
1,340
fromAscListWithKey :: Eq k => (k -> a -> a -> a) -> [(k,a)] -> Map k a fromAscListWithKey f xs = fromDistinctAscList (combineEq f xs) where -- [combineEq f xs] combines equal elements with function [f] in an ordered list [xs] combineEq _ xs' = case xs' of [] -> [] [x] -> [x] (...
853
fromAscListWithKey f xs = fromDistinctAscList (combineEq f xs) where -- [combineEq f xs] combines equal elements with function [f] in an ordered list [xs] combineEq _ xs' = case xs' of [] -> [] [x] -> [x] (x:xx) -> combineEq' x xx combineEq' z [] = [z] combineEq' z@(kz,zz...
782
true
true
4
10
294
270
138
132
null
null
DavidAlphaFox/darcs
src/Darcs/Patch/ConflictMarking.hs
gpl-2.0
getHunkline :: [[Maybe B.ByteString]] -> Int getHunkline = ghl 1 where ghl :: Int -> [[Maybe B.ByteString]] -> Int ghl n pps = if any (isJust . head) pps then n else ghl (n+1) $ map tail pps
240
getHunkline :: [[Maybe B.ByteString]] -> Int getHunkline = ghl 1 where ghl :: Int -> [[Maybe B.ByteString]] -> Int ghl n pps = if any (isJust . head) pps then n else ghl (n+1) $ map tail pps
240
getHunkline = ghl 1 where ghl :: Int -> [[Maybe B.ByteString]] -> Int ghl n pps = if any (isJust . head) pps then n else ghl (n+1) $ map tail pps
195
false
true
3
9
87
105
54
51
null
null
saep/repo-based-blog
test-suite/Web/RBB/Crawler/RepositorySpec.hs
bsd-3-clause
spec :: Spec spec = do describe "findDirInParents" $ do it "should detect this git repository as the directory for .git" $ do repo <- findDirInParents "test-resources" ".git" cwd <- getCurrentDirectory >>= canonicalizePath repo `shouldBe` Just cwd it "should find...
2,276
spec :: Spec spec = do describe "findDirInParents" $ do it "should detect this git repository as the directory for .git" $ do repo <- findDirInParents "test-resources" ".git" cwd <- getCurrentDirectory >>= canonicalizePath repo `shouldBe` Just cwd it "should find...
2,276
spec = do describe "findDirInParents" $ do it "should detect this git repository as the directory for .git" $ do repo <- findDirInParents "test-resources" ".git" cwd <- getCurrentDirectory >>= canonicalizePath repo `shouldBe` Just cwd it "should find the pseudo _...
2,263
false
true
0
30
717
564
268
296
null
null
oldmanmike/ghc
compiler/types/Type.hs
bsd-3-clause
typeKind (ForAllTy (Anon _) _) = liftedTypeKind
47
typeKind (ForAllTy (Anon _) _) = liftedTypeKind
47
typeKind (ForAllTy (Anon _) _) = liftedTypeKind
47
false
false
0
8
6
24
11
13
null
null
jean-edouard/manager
apptool/apptool.hs
gpl-2.0
listApp :: Rpc () listApp = mapM_ (liftIO . putStrLn . showID) =<< enumAppliances where showID (AppID name ver) = name
120
listApp :: Rpc () listApp = mapM_ (liftIO . putStrLn . showID) =<< enumAppliances where showID (AppID name ver) = name
120
listApp = mapM_ (liftIO . putStrLn . showID) =<< enumAppliances where showID (AppID name ver) = name
102
false
true
1
9
22
57
26
31
null
null
gspindles/rftg-cards
src/Game/RftG/Cards/XI.hs
mit
rebelBlackMarketGangs :: Card rebelBlackMarketGangs = Card (World $ Windfall NoveltyGoods) "REBEL BLACK MARKET GANGS" (Defense 1) (VP 0) Nothing [Rebel] [Settle, Trade]
182
rebelBlackMarketGangs :: Card rebelBlackMarketGangs = Card (World $ Windfall NoveltyGoods) "REBEL BLACK MARKET GANGS" (Defense 1) (VP 0) Nothing [Rebel] [Settle, Trade]
182
rebelBlackMarketGangs = Card (World $ Windfall NoveltyGoods) "REBEL BLACK MARKET GANGS" (Defense 1) (VP 0) Nothing [Rebel] [Settle, Trade]
152
false
true
0
7
35
63
30
33
null
null
olsner/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
weakPrimTyConKey = mkPreludeTyConUnique 27
65
weakPrimTyConKey = mkPreludeTyConUnique 27
65
weakPrimTyConKey = mkPreludeTyConUnique 27
65
false
false
0
5
26
9
4
5
null
null
tauli/LambdaLudo
examples/gomoku/Main.hs
bsd-3-clause
handle :: Handle Player () handle (MouseClick p) = do state <- get let spr = playerSprite state alreadyMarked <- marked p if alreadyMarked then nop else do createSprite p 1 spr put $ nextPlayer state
215
handle :: Handle Player () handle (MouseClick p) = do state <- get let spr = playerSprite state alreadyMarked <- marked p if alreadyMarked then nop else do createSprite p 1 spr put $ nextPlayer state
215
handle (MouseClick p) = do state <- get let spr = playerSprite state alreadyMarked <- marked p if alreadyMarked then nop else do createSprite p 1 spr put $ nextPlayer state
188
false
true
1
12
51
92
39
53
null
null
kishoredbn/barrelfish
hake/RuleDefs.hs
mit
flounderTHCFile :: Options -> String -> HRule flounderTHCFile opts ifn = flounderRule opts [ Str "--thc-header", flounderIfFileLoc ifn, Out (optArch opts) (flounderTHCHdrPath ifn) ]
216
flounderTHCFile :: Options -> String -> HRule flounderTHCFile opts ifn = flounderRule opts [ Str "--thc-header", flounderIfFileLoc ifn, Out (optArch opts) (flounderTHCHdrPath ifn) ]
216
flounderTHCFile opts ifn = flounderRule opts [ Str "--thc-header", flounderIfFileLoc ifn, Out (optArch opts) (flounderTHCHdrPath ifn) ]
170
false
true
0
9
58
61
30
31
null
null
jstolarek/ghc
libraries/base/GHC/Word.hs
bsd-3-clause
byteSwap16 :: Word16 -> Word16 byteSwap16 (W16# w#) = W16# (narrow16Word# (byteSwap16# w#))
91
byteSwap16 :: Word16 -> Word16 byteSwap16 (W16# w#) = W16# (narrow16Word# (byteSwap16# w#))
91
byteSwap16 (W16# w#) = W16# (narrow16Word# (byteSwap16# w#))
60
false
true
0
9
12
39
19
20
null
null
mettekou/ghc
compiler/deSugar/DsArrows.hs
bsd-3-clause
matchSimplys (exp:exps) ctxt (pat:pats) result_expr fail_expr = do match_code <- matchSimplys exps ctxt pats result_expr fail_expr matchSimply exp ctxt pat match_code fail_expr
184
matchSimplys (exp:exps) ctxt (pat:pats) result_expr fail_expr = do match_code <- matchSimplys exps ctxt pats result_expr fail_expr matchSimply exp ctxt pat match_code fail_expr
184
matchSimplys (exp:exps) ctxt (pat:pats) result_expr fail_expr = do match_code <- matchSimplys exps ctxt pats result_expr fail_expr matchSimply exp ctxt pat match_code fail_expr
184
false
false
0
8
29
63
30
33
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Attrs/Aria.hs
bsd-3-clause
aLabelledby = aNmVal "labelledby"
39
aLabelledby = aNmVal "labelledby"
39
aLabelledby = aNmVal "labelledby"
39
false
false
0
5
9
9
4
5
null
null