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
AlexanderPankiv/ghc
compiler/types/Type.hs
bsd-3-clause
getTyVar_maybe (TyVarTy tv) = Just tv
53
getTyVar_maybe (TyVarTy tv) = Just tv
53
getTyVar_maybe (TyVarTy tv) = Just tv
53
false
false
0
6
21
19
8
11
null
null
aszlig/language-javascript
src/Language/JavaScript/Pretty/Printer.hs
bsd-3-clause
-- rn (NN (JSSourceElements xs)) foo = rJS xs foo rn (NN (JSSourceElementsTop xs)) foo = rJS xs foo
136
rn (NN (JSSourceElementsTop xs)) foo = rJS xs foo
66
rn (NN (JSSourceElementsTop xs)) foo = rJS xs foo
66
true
false
0
9
55
29
14
15
null
null
gcampax/ghc
compiler/typecheck/TcGenDeriv.hs
bsd-3-clause
gen_Bounded_binds :: SrcSpan -> TyCon -> (LHsBinds RdrName, BagDerivStuff) gen_Bounded_binds loc tycon | isEnumerationTyCon tycon = (listToBag [ min_bound_enum, max_bound_enum ], emptyBag) | otherwise = ASSERT(isSingleton data_cons) (listToBag [ min_bound_1con, max_bound_1con ], emptyBag) where data_c...
2,875
gen_Bounded_binds :: SrcSpan -> TyCon -> (LHsBinds RdrName, BagDerivStuff) gen_Bounded_binds loc tycon | isEnumerationTyCon tycon = (listToBag [ min_bound_enum, max_bound_enum ], emptyBag) | otherwise = ASSERT(isSingleton data_cons) (listToBag [ min_bound_1con, max_bound_1con ], emptyBag) where data_c...
2,875
gen_Bounded_binds loc tycon | isEnumerationTyCon tycon = (listToBag [ min_bound_enum, max_bound_enum ], emptyBag) | otherwise = ASSERT(isSingleton data_cons) (listToBag [ min_bound_1con, max_bound_1con ], emptyBag) where data_cons = tyConDataCons tycon ----- enum-flavored: -----------------------...
2,800
false
true
1
8
821
242
120
122
null
null
idupree/haskell-time-steward
TestSim.hs
gpl-3.0
tests :: TestTree tests = localOption (mkTimeout (1*1000000)) $ --localOption (SmallCheckDepth 3) $ testGroup "Tests" [scProps, qcProps]
142
tests :: TestTree tests = localOption (mkTimeout (1*1000000)) $ --localOption (SmallCheckDepth 3) $ testGroup "Tests" [scProps, qcProps]
142
tests = localOption (mkTimeout (1*1000000)) $ --localOption (SmallCheckDepth 3) $ testGroup "Tests" [scProps, qcProps]
124
false
true
0
10
22
43
23
20
null
null
blambo/accelerate-examples
tests/primitives/ScanSeg.hs
bsd-3-clause
run :: String -> Int -> IO (() -> UArray Int Float, () -> Acc (Vector Float)) run alg m = withSystemRandom $ \gen -> do let n = P.round . sqrt $ (P.fromIntegral m :: Double) seg <- randomUArrayR (0,n) gen n seg' <- convertUArray seg let ne = sum (elems seg) vec <- randomUArrayR (-1,1) gen ne vec' <- conve...
615
run :: String -> Int -> IO (() -> UArray Int Float, () -> Acc (Vector Float)) run alg m = withSystemRandom $ \gen -> do let n = P.round . sqrt $ (P.fromIntegral m :: Double) seg <- randomUArrayR (0,n) gen n seg' <- convertUArray seg let ne = sum (elems seg) vec <- randomUArrayR (-1,1) gen ne vec' <- conve...
615
run alg m = withSystemRandom $ \gen -> do let n = P.round . sqrt $ (P.fromIntegral m :: Double) seg <- randomUArrayR (0,n) gen n seg' <- convertUArray seg let ne = sum (elems seg) vec <- randomUArrayR (-1,1) gen ne vec' <- convertUArray vec -- let go f g = return (run_ref f vec seg, run_acc g vec' seg...
537
false
true
0
15
163
304
142
162
null
null
databrary/databrary
src/View/Html.hs
agpl-3.0
actionLink :: QueryLike q => R.RouteAction r a -> r -> q -> H.Attribute actionLink r a = HA.href . actionValue r a
114
actionLink :: QueryLike q => R.RouteAction r a -> r -> q -> H.Attribute actionLink r a = HA.href . actionValue r a
114
actionLink r a = HA.href . actionValue r a
42
false
true
0
9
22
55
26
29
null
null
urbanslug/ghc
compiler/llvmGen/LlvmCodeGen/Regs.hs
bsd-3-clause
-- | STG Type Based Alias Analysis hierarchy stgTBAA :: [(Unique, LMString, Maybe Unique)] stgTBAA = [ (topN, fsLit "top", Nothing) , (stackN, fsLit "stack", Just topN) , (heapN, fsLit "heap", Just topN) , (rxN, fsLit "rx", Just heapN) , (baseN, fsLit "base", Just topN) -- FIX: Not 1...
621
stgTBAA :: [(Unique, LMString, Maybe Unique)] stgTBAA = [ (topN, fsLit "top", Nothing) , (stackN, fsLit "stack", Just topN) , (heapN, fsLit "heap", Just topN) , (rxN, fsLit "rx", Just heapN) , (baseN, fsLit "base", Just topN) -- FIX: Not 100% sure about 'others' place. Might need to ...
576
stgTBAA = [ (topN, fsLit "top", Nothing) , (stackN, fsLit "stack", Just topN) , (heapN, fsLit "heap", Just topN) , (rxN, fsLit "rx", Just heapN) , (baseN, fsLit "base", Just topN) -- FIX: Not 100% sure about 'others' place. Might need to be under 'heap'. -- OR I think the big thi...
530
true
true
2
8
161
143
79
64
null
null
ezyang/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
---------------- Template Haskell ------------------- -- THNames.hs: USES ClassUniques 200-299 ----------------------------------------------------- {- ************************************************************************ * * \subsubsection[U...
1,386
addrPrimTyConKey, arrayPrimTyConKey, arrayArrayPrimTyConKey, boolTyConKey, byteArrayPrimTyConKey, charPrimTyConKey, charTyConKey, doublePrimTyConKey, doubleTyConKey, floatPrimTyConKey, floatTyConKey, funTyConKey, intPrimTyConKey, intTyConKey, int8TyConKey, int16TyConKey, int32PrimTyConKey, int32TyConKey...
860
addrPrimTyConKey = mkPreludeTyConUnique 1
65
true
true
2
5
280
100
89
11
null
null
dterei/Scraps
haskell/lenses/Types.hs
bsd-3-clause
-- updating sucks! editEffect :: (OutlierEffect -> OutlierEffect) -> Payload -> Payload editEffect eff payload = payload { sampleAnalysis = analysis { anOutlierVar = variance { ovEffect = eff effect } } } where analysis = sampleAnalysis payload variance...
506
editEffect :: (OutlierEffect -> OutlierEffect) -> Payload -> Payload editEffect eff payload = payload { sampleAnalysis = analysis { anOutlierVar = variance { ovEffect = eff effect } } } where analysis = sampleAnalysis payload variance = anOutlierVar ana...
487
editEffect eff payload = payload { sampleAnalysis = analysis { anOutlierVar = variance { ovEffect = eff effect } } } where analysis = sampleAnalysis payload variance = anOutlierVar analysis effect = ovEffect variance -- haskell record update syntax a no...
407
true
true
2
11
144
88
48
40
null
null
thalerjonathan/phd
thesis/code/sugarscape/src/SugarScape/Core/Utils.hs
gpl-3.0
orM :: Monad m => m Bool -> m Bool -> m Bool orM = liftM2 (||)
74
orM :: Monad m => m Bool -> m Bool -> m Bool orM = liftM2 (||)
74
orM = liftM2 (||)
17
false
true
0
9
28
46
20
26
null
null
mightymoose/liquidhaskell
tests/pos/AVLRJ.hs
bsd-3-clause
rebalanceLL v (Tree lv ll lr) r = Tree lv ll (Tree v lr r)
74
rebalanceLL v (Tree lv ll lr) r = Tree lv ll (Tree v lr r)
74
rebalanceLL v (Tree lv ll lr) r = Tree lv ll (Tree v lr r)
74
false
false
0
7
30
40
19
21
null
null
cirquit/hjc
src/Cmm/X86/Core.hs
mit
label :: (MonadNameGen m, MonadIO m) => Label -> X86 m () label l = label_c l emptyComment
90
label :: (MonadNameGen m, MonadIO m) => Label -> X86 m () label l = label_c l emptyComment
90
label l = label_c l emptyComment
32
false
true
0
8
17
45
22
23
null
null
thomasjm/IHaskell
ipython-kernel/src/IHaskell/IPython/Types.hs
mit
showMessageType InputMessage = "pyin"
37
showMessageType InputMessage = "pyin"
37
showMessageType InputMessage = "pyin"
37
false
false
0
5
3
9
4
5
null
null
bmmoore/logic
Logic/Resolution.hs
bsd-3-clause
revApp [] bs = bs
17
revApp [] bs = bs
17
revApp [] bs = bs
17
false
false
0
6
4
13
6
7
null
null
ababkin/partial_inspector
src/Vim/Netbeans/Protocol.hs
mit
printCommandName NetbeansBuffer {} = "netbeansBuffer"
53
printCommandName NetbeansBuffer {} = "netbeansBuffer"
53
printCommandName NetbeansBuffer {} = "netbeansBuffer"
53
false
false
0
5
4
14
6
8
null
null
thalerjonathan/phd
coding/libraries/chimera/examples/ABS/SIRExamples/FrSIRSSpatial/Model.hs
gpl-3.0
-- average number of contacts per time-unit contactRate :: Double contactRate = 5
81
contactRate :: Double contactRate = 5
37
contactRate = 5
15
true
true
0
4
12
12
7
5
null
null
linuborj/cubicaltt
Resolver.hs
mit
unVar _ = Nothing
36
unVar _ = Nothing
36
unVar _ = Nothing
36
false
false
0
5
22
9
4
5
null
null
ddssff/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
doLHSverb :: LP Inlines doLHSverb = codeWith ("",["haskell"],[]) <$> manyTill (satisfy (/='\n')) (char '|')
107
doLHSverb :: LP Inlines doLHSverb = codeWith ("",["haskell"],[]) <$> manyTill (satisfy (/='\n')) (char '|')
107
doLHSverb = codeWith ("",["haskell"],[]) <$> manyTill (satisfy (/='\n')) (char '|')
83
false
true
0
9
13
56
30
26
null
null
fpco/stackage-server
bench/main.hs
mit
createBenchPool :: IO ConnectionPool createBenchPool = do loadYamlSettingsArgs [configSettingsYmlValue] useEnv >>= \case AppSettings{appDatabase = DSPostgres pgString _} -> runNoLoggingT $ createPostgresqlPool (encodeUtf8 pgString) 1 _ -> throwString "Benchmarks are crafted for PostgreSQ...
322
createBenchPool :: IO ConnectionPool createBenchPool = do loadYamlSettingsArgs [configSettingsYmlValue] useEnv >>= \case AppSettings{appDatabase = DSPostgres pgString _} -> runNoLoggingT $ createPostgresqlPool (encodeUtf8 pgString) 1 _ -> throwString "Benchmarks are crafted for PostgreSQ...
322
createBenchPool = do loadYamlSettingsArgs [configSettingsYmlValue] useEnv >>= \case AppSettings{appDatabase = DSPostgres pgString _} -> runNoLoggingT $ createPostgresqlPool (encodeUtf8 pgString) 1 _ -> throwString "Benchmarks are crafted for PostgreSQL"
285
false
true
0
15
63
81
37
44
null
null
siddhanathan/yi
yi-keymap-vim/src/Yi/Keymap/Vim/Motion.hs
gpl-2.0
matchGotoMarkMove (m:c:[]) = WholeMatch $ Move style True action where style = if m == '`' then Inclusive else LineWise action _mcount = do mmark <- mayGetMarkB [c] case mmark of Nothing -> fail $ "Mark " <> show c <> " not set" Just mark -> ...
352
matchGotoMarkMove (m:c:[]) = WholeMatch $ Move style True action where style = if m == '`' then Inclusive else LineWise action _mcount = do mmark <- mayGetMarkB [c] case mmark of Nothing -> fail $ "Mark " <> show c <> " not set" Just mark -> ...
352
matchGotoMarkMove (m:c:[]) = WholeMatch $ Move style True action where style = if m == '`' then Inclusive else LineWise action _mcount = do mmark <- mayGetMarkB [c] case mmark of Nothing -> fail $ "Mark " <> show c <> " not set" Just mark -> ...
352
false
false
1
15
129
125
60
65
null
null
mitchellwrosen/haskell-erlang-bridge
src/Erlang/Distribution/Internal.hs
lgpl-3.0
-- | Get a list of elements preceded by their length, give a getter for -- the length and a getter for a single element. getListWith :: Integral a => Get a -> Get r -> Get [r] getListWith len x = len >>= \n -> replicateM (fromIntegral n) x
239
getListWith :: Integral a => Get a -> Get r -> Get [r] getListWith len x = len >>= \n -> replicateM (fromIntegral n) x
118
getListWith len x = len >>= \n -> replicateM (fromIntegral n) x
63
true
true
0
9
49
65
32
33
null
null
rueshyna/gogol
gogol-partners/gen/Network/Google/Resource/Partners/Companies/List.hs
mpl-2.0
-- | Company name to search for. clCompanyName :: Lens' CompaniesList (Maybe Text) clCompanyName = lens _clCompanyName (\ s a -> s{_clCompanyName = a})
159
clCompanyName :: Lens' CompaniesList (Maybe Text) clCompanyName = lens _clCompanyName (\ s a -> s{_clCompanyName = a})
126
clCompanyName = lens _clCompanyName (\ s a -> s{_clCompanyName = a})
76
true
true
1
9
31
52
25
27
null
null
noteed/opengl-api
Text/OpenGL/Spec.hs
bsd-3-clause
isDeprecated :: Prop -> Bool isDeprecated (Deprecated _ _) = True
65
isDeprecated :: Prop -> Bool isDeprecated (Deprecated _ _) = True
65
isDeprecated (Deprecated _ _) = True
36
false
true
0
7
10
26
13
13
null
null
erochest/todotxt
Gtd/RDF.hs
apache-2.0
makeStringName :: NamespaceMap -> T.Text -> String -> Maybe ScopedName makeStringName nss pre = makeTextName nss pre . T.pack
125
makeStringName :: NamespaceMap -> T.Text -> String -> Maybe ScopedName makeStringName nss pre = makeTextName nss pre . T.pack
125
makeStringName nss pre = makeTextName nss pre . T.pack
54
false
true
0
8
18
44
21
23
null
null
jcollard/unm-hip
Data/Image/Binary.hs
gpl-3.0
(/=.) :: (Image img, BinaryPixel (Pixel img), Eq (Pixel img), Pixel img ~ a) => a -> img -> img (/=.) = flip (./=)
144
(/=.) :: (Image img, BinaryPixel (Pixel img), Eq (Pixel img), Pixel img ~ a) => a -> img -> img (/=.) = flip (./=)
144
(/=.) = flip (./=)
18
false
true
0
8
53
72
39
33
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Relaxngcompact.hs
gpl-2.0
parseRules ("RelaxNG-Compact","String") = (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext)) <|> (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","String")) >> pDefault >>= withAttribute StringTok))
235
parseRules ("RelaxNG-Compact","String") = (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext)) <|> (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","String")) >> pDefault >>= withAttribute StringTok))
235
parseRules ("RelaxNG-Compact","String") = (((pDetectChar False '"' >>= withAttribute StringTok) >>~ (popContext)) <|> (currentContext >>= \x -> guard (x == ("RelaxNG-Compact","String")) >> pDefault >>= withAttribute StringTok))
235
false
false
0
15
32
86
46
40
null
null
psibi/yesod
yesod-auth/Yesod/Auth.hs
mit
getLogoutR :: AuthHandler master () getLogoutR = do tp <- getRouteToParent setUltDestReferer' >> redirectToPost (tp LogoutR)
128
getLogoutR :: AuthHandler master () getLogoutR = do tp <- getRouteToParent setUltDestReferer' >> redirectToPost (tp LogoutR)
128
getLogoutR = do tp <- getRouteToParent setUltDestReferer' >> redirectToPost (tp LogoutR)
92
false
true
0
10
19
41
19
22
null
null
andorp/hs-bluesnap
src/Bluesnap/API/Request.hs
gpl-3.0
elementToXMLPrice :: Price -> [Content ()] elementToXMLPrice = schemaTypeToXML "price"
86
elementToXMLPrice :: Price -> [Content ()] elementToXMLPrice = schemaTypeToXML "price"
86
elementToXMLPrice = schemaTypeToXML "price"
43
false
true
0
8
9
26
13
13
null
null
shlevy/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
sndIdKey = mkPreludeMiscIdUnique 42
56
sndIdKey = mkPreludeMiscIdUnique 42
56
sndIdKey = mkPreludeMiscIdUnique 42
56
false
false
0
5
24
9
4
5
null
null
gambogi/csh-eval
src/CSH/Eval/LDAP.hs
mit
-- Listen, I'm sorry extractValue _ = Nothing
77
extractValue _ = Nothing
56
extractValue _ = Nothing
56
true
false
0
4
39
11
5
6
null
null
barrucadu/nagi
lib/Imageboard/Database.hs
mit
-- | Construct a 'ThreadId' from an 'Int'. toThreadId :: Int64 -> ThreadId toThreadId = ThreadKey . SqlBackendKey
113
toThreadId :: Int64 -> ThreadId toThreadId = ThreadKey . SqlBackendKey
70
toThreadId = ThreadKey . SqlBackendKey
38
true
true
0
5
17
20
11
9
null
null
candu/haskellbook
ch6/matchTheTypes.hs
mit
f :: RealFrac a => a -- f :: Num a => a fails f = 1.0
53
f :: RealFrac a => a f = 1.0
28
f = 1.0
7
true
true
0
7
16
26
11
15
null
null
Fuuzetsu/yi-emacs-colours
src/Yi/Style/EmacsColours.hs
gpl-2.0
-- | Names: @["DeepPink3"]@ -- -- R205 G16 B118, 0xcd1076 deepPink3 :: Color deepPink3 = RGB 205 16 118
103
deepPink3 :: Color deepPink3 = RGB 205 16 118
45
deepPink3 = RGB 205 16 118
26
true
true
0
6
18
27
13
14
null
null
nevrenato/Hets_Fork
THF/Translate.hs
gpl-2.0
maybeElem :: Id -> Map.Map Id a -> Maybe a maybeElem id1 m = helper id1 (Map.toList m) where helper :: Id -> [(Id, a)] -> Maybe a helper _ [] = Nothing helper id2 ((eid, ea) : r) = if myEqId id2 eid then Just ea else helper id2 r
269
maybeElem :: Id -> Map.Map Id a -> Maybe a maybeElem id1 m = helper id1 (Map.toList m) where helper :: Id -> [(Id, a)] -> Maybe a helper _ [] = Nothing helper id2 ((eid, ea) : r) = if myEqId id2 eid then Just ea else helper id2 r
269
maybeElem id1 m = helper id1 (Map.toList m) where helper :: Id -> [(Id, a)] -> Maybe a helper _ [] = Nothing helper id2 ((eid, ea) : r) = if myEqId id2 eid then Just ea else helper id2 r
226
false
true
0
9
90
142
68
74
null
null
AndreasPK/stack
src/Stack/Upgrade.hs
bsd-3-clause
binaryUpgrade :: (StackM env m, HasConfig env) => BinaryOpts -> m () binaryUpgrade (BinaryOpts mplatform force' mver morg mrepo) = do platforms0 <- case mplatform of Nothing -> preferredPlatforms Just p -> return [("windows" `T.isInfixOf` T.pack p, p)] archiveInfo <- downloadStackRel...
1,960
binaryUpgrade :: (StackM env m, HasConfig env) => BinaryOpts -> m () binaryUpgrade (BinaryOpts mplatform force' mver morg mrepo) = do platforms0 <- case mplatform of Nothing -> preferredPlatforms Just p -> return [("windows" `T.isInfixOf` T.pack p, p)] archiveInfo <- downloadStackRel...
1,960
binaryUpgrade (BinaryOpts mplatform force' mver morg mrepo) = do platforms0 <- case mplatform of Nothing -> preferredPlatforms Just p -> return [("windows" `T.isInfixOf` T.pack p, p)] archiveInfo <- downloadStackReleaseInfo morg mrepo mver let mdownloadVersion = getDownloadVersion arc...
1,885
false
true
0
18
708
435
201
234
null
null
uduki/hsQt
Qtc/Gui/QPen.hs
bsd-2-clause
setMiterLimit :: QPen a -> ((Double)) -> IO () setMiterLimit x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QPen_setMiterLimit cobj_x0 (toCDouble x1)
153
setMiterLimit :: QPen a -> ((Double)) -> IO () setMiterLimit x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QPen_setMiterLimit cobj_x0 (toCDouble x1)
153
setMiterLimit x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QPen_setMiterLimit cobj_x0 (toCDouble x1)
106
false
true
0
9
27
64
32
32
null
null
lovasko/rset
test/Prop.hs
bsd-2-clause
sizeTest :: [Word8] -- ^ points -> Bool -- ^ result sizeTest xs = rset == set where rset = (R.size . R.fromList) xs :: Integer set = (genericLength . nub) xs :: Integer -- | Test the conversion from and to ascending lists.
241
sizeTest :: [Word8] -- ^ points -> Bool sizeTest xs = rset == set where rset = (R.size . R.fromList) xs :: Integer set = (genericLength . nub) xs :: Integer -- | Test the conversion from and to ascending lists.
226
sizeTest xs = rset == set where rset = (R.size . R.fromList) xs :: Integer set = (genericLength . nub) xs :: Integer -- | Test the conversion from and to ascending lists.
182
true
true
3
8
62
77
40
37
null
null
keera-studios/hsQt
Qtc/Enums/Network/QUdpSocket.hs
bsd-2-clause
eDefaultForPlatform :: BindFlag eDefaultForPlatform = ieBindFlag $ 0
70
eDefaultForPlatform :: BindFlag eDefaultForPlatform = ieBindFlag $ 0
70
eDefaultForPlatform = ieBindFlag $ 0
38
false
true
2
6
9
23
9
14
null
null
ygale/yesod
yesod-core/Yesod/Core/Class/Yesod.hs
mit
sslOnlyMiddleware :: Yesod site => Int -- ^ minutes -> HandlerT site IO res -> HandlerT site IO res sslOnlyMiddleware timeout handler = do addHeader "Strict-Transport-Security" $ T.pack $ concat [ "max-age=" ...
551
sslOnlyMiddleware :: Yesod site => Int -- ^ minutes -> HandlerT site IO res -> HandlerT site IO res sslOnlyMiddleware timeout handler = do addHeader "Strict-Transport-Security" $ T.pack $ concat [ "max-age=" ...
551
sslOnlyMiddleware timeout handler = do addHeader "Strict-Transport-Security" $ T.pack $ concat [ "max-age=" , show $ timeout * 60 , "; includeSubDomains" ] handler -- | Check if a given request is auth...
388
false
true
0
11
242
89
45
44
null
null
martin-kolinek/some-board-game-rules
test/Interaction/BuildingProperties.hs
mit
getBuildingExtractor :: BuildingDescription -> Universe -> PlayerId -> [(Position, Direction)] getBuildingExtractor (DoubleSmallBuildingDesc Grass Field) = availableForestPositions
180
getBuildingExtractor :: BuildingDescription -> Universe -> PlayerId -> [(Position, Direction)] getBuildingExtractor (DoubleSmallBuildingDesc Grass Field) = availableForestPositions
180
getBuildingExtractor (DoubleSmallBuildingDesc Grass Field) = availableForestPositions
85
false
true
0
9
15
47
24
23
null
null
geraldus/transient
src/Transient/Internals.hs
mit
forkFinally1 :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId forkFinally1 action and_then = mask $ \restore -> forkIO $ try (restore action) >>= and_then
168
forkFinally1 :: IO a -> (Either SomeException a -> IO ()) -> IO ThreadId forkFinally1 action and_then = mask $ \restore -> forkIO $ try (restore action) >>= and_then
168
forkFinally1 action and_then = mask $ \restore -> forkIO $ try (restore action) >>= and_then
95
false
true
2
10
31
75
35
40
null
null
Chatanga/kage
src/Graphics/Color.hs
mit
cyan = mkColor 0 255 255
24
cyan = mkColor 0 255 255
24
cyan = mkColor 0 255 255
24
false
false
0
5
5
13
6
7
null
null
copton/ocram
ocram/src/Ocram/Intermediate/DesugarControlStructures.hs
gpl-2.0
groupCases :: [CBlockItem] -> [(Maybe CExpr, [CBlockItem])] -- {{{2 groupCases xs = case xs of [] -> [] (CBlockStmt item):rest -> case item of CCase expr stmt _ -> let stmt' = CBlockStmt stmt in if isCaseDefault stmt' then (Just expr, [CBlockStmt (CExpr Nothing undefNode)]) : groupCases (stm...
847
groupCases :: [CBlockItem] -> [(Maybe CExpr, [CBlockItem])] groupCases xs = case xs of [] -> [] (CBlockStmt item):rest -> case item of CCase expr stmt _ -> let stmt' = CBlockStmt stmt in if isCaseDefault stmt' then (Just expr, [CBlockStmt (CExpr Nothing undefNode)]) : groupCases (stmt':rest)...
839
groupCases xs = case xs of [] -> [] (CBlockStmt item):rest -> case item of CCase expr stmt _ -> let stmt' = CBlockStmt stmt in if isCaseDefault stmt' then (Just expr, [CBlockStmt (CExpr Nothing undefNode)]) : groupCases (stmt':rest) else let (block, others) = span (not . i...
779
true
true
0
20
243
352
175
177
null
null
arzig/hednist
src/Data/Hednist/Parser.hs
bsd-3-clause
character :: Parser EDNValue character = backslash *> (try lf <|> try cr <|> try space <|> try tab <|> try (fmap EDNChar unicode) <|> EDNChar <$> anyChar) where lf = string "newline" *> pure (EDNChar '\n') cr = string "return" *> pure (EDNChar '\r') ...
499
character :: Parser EDNValue character = backslash *> (try lf <|> try cr <|> try space <|> try tab <|> try (fmap EDNChar unicode) <|> EDNChar <$> anyChar) where lf = string "newline" *> pure (EDNChar '\n') cr = string "return" *> pure (EDNChar '\r') ...
499
character = backslash *> (try lf <|> try cr <|> try space <|> try tab <|> try (fmap EDNChar unicode) <|> EDNChar <$> anyChar) where lf = string "newline" *> pure (EDNChar '\n') cr = string "return" *> pure (EDNChar '\r') space = string "sp...
470
false
true
4
13
177
173
82
91
null
null
geraldus/yesod
yesod-core/src/Yesod/Routes/Parse.hs
mit
pieceFromString ('!':'*':x) = Left (False, x)
45
pieceFromString ('!':'*':x) = Left (False, x)
45
pieceFromString ('!':'*':x) = Left (False, x)
45
false
false
0
8
5
29
15
14
null
null
noteed/mojito
Language/Mojito/Syntax/ExprBuilder.hs
bsd-3-clause
buildPatOrVar :: MonadError String m => SExpr -> ExprT m (Pattern Int) buildPatOrVar e = case e of List (Sym c:as) -> do i <- newId i' <- newId as' <- mapM buildPatOrVar as return $ PatCon i i' c as' Sym a -> do i <- newId return $ PatVar i a _ -> throwError $ "unexpected s-expression for ...
340
buildPatOrVar :: MonadError String m => SExpr -> ExprT m (Pattern Int) buildPatOrVar e = case e of List (Sym c:as) -> do i <- newId i' <- newId as' <- mapM buildPatOrVar as return $ PatCon i i' c as' Sym a -> do i <- newId return $ PatVar i a _ -> throwError $ "unexpected s-expression for ...
340
buildPatOrVar e = case e of List (Sym c:as) -> do i <- newId i' <- newId as' <- mapM buildPatOrVar as return $ PatCon i i' c as' Sym a -> do i <- newId return $ PatVar i a _ -> throwError $ "unexpected s-expression for pattern " ++ show e
269
false
true
3
9
95
150
67
83
null
null
gbataille/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
circ 'j' = "ĵ"
14
circ 'j' = "ĵ"
14
circ 'j' = "ĵ"
14
false
false
1
5
3
13
4
9
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_EIFFEL_CHARACTER :: Int wxSTC_EIFFEL_CHARACTER = 5
56
wxSTC_EIFFEL_CHARACTER :: Int wxSTC_EIFFEL_CHARACTER = 5
56
wxSTC_EIFFEL_CHARACTER = 5
26
false
true
0
6
5
18
7
11
null
null
moonKimura/vector-0.10.9.1
Data/Vector/Fusion/Stream.hs
bsd-3-clause
enumFromTo = M.enumFromTo
25
enumFromTo = M.enumFromTo
25
enumFromTo = M.enumFromTo
25
false
false
0
5
2
8
4
4
null
null
acowley/roshask
src/Ros/Internal/DepFinder.hs
bsd-3-clause
{- -- |Returns 'True' if the ROS package at the given 'FilePath' is a -- roshask package (determined by the presence of a @.cabal@ file in -- the package's root directory). isRoshask :: FilePath -> IO Bool isRoshask pkgPath = not . null . filter ((== ".cabal") . takeExtension) <$> getDirectoryConten...
911
findDepsWithMessages :: FilePath -> IO [String] findDepsWithMessages pkgRoot = do names <- findPackageDepNames pkgRoot searchPaths <- getRosPaths filterM (maybe (return False) hasMsgsOrSrvs . findPackagePath searchPaths) names -- |Find the paths to the packages this package depends on as -- indicated by th...
376
findDepsWithMessages pkgRoot = do names <- findPackageDepNames pkgRoot searchPaths <- getRosPaths filterM (maybe (return False) hasMsgsOrSrvs . findPackagePath searchPaths) names -- |Find the paths to the packages this package depends on as -- indicated by the manifest.xml file in this package's root -- di...
328
true
true
0
12
170
77
39
38
null
null
gibiansky/IHaskell
ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Int/BoundedInt/BoundedIntText.hs
mit
-- | Create a new widget mkBoundedIntText :: IO BoundedIntText mkBoundedIntText = do -- Default properties, with a random uuid wid <- U.random layout <- mkLayout dstyle <- mkDescriptionStyle let boundedIntAttrs = defaultBoundedIntWidget "IntTextView" "BoundedIntTextModel" layout $ StyleWidget dstyle te...
762
mkBoundedIntText :: IO BoundedIntText mkBoundedIntText = do -- Default properties, with a random uuid wid <- U.random layout <- mkLayout dstyle <- mkDescriptionStyle let boundedIntAttrs = defaultBoundedIntWidget "IntTextView" "BoundedIntTextModel" layout $ StyleWidget dstyle textAttrs = (Disabled =:: F...
737
mkBoundedIntText = do -- Default properties, with a random uuid wid <- U.random layout <- mkLayout dstyle <- mkDescriptionStyle let boundedIntAttrs = defaultBoundedIntWidget "IntTextView" "BoundedIntTextModel" layout $ StyleWidget dstyle textAttrs = (Disabled =:: False) :& (Continuous...
699
true
true
0
14
189
161
77
84
null
null
CloudI/CloudI
src/api/haskell/external/zlib-0.6.2.1/Codec/Compression/Zlib/Internal.hs
mit
mkStateIO :: IO (Stream.State RealWorld) mkStateST = strictToLazyST Stream.mkState
82
mkStateIO :: IO (Stream.State RealWorld) mkStateST = strictToLazyST Stream.mkState
82
mkStateST = strictToLazyST Stream.mkState
41
false
true
0
8
8
27
13
14
null
null
hspec/sensei
src/HTTP.hs
mit
withServer :: IO (Bool, String) -> IO a -> IO a withServer trigger = withApplication (app trigger)
98
withServer :: IO (Bool, String) -> IO a -> IO a withServer trigger = withApplication (app trigger)
98
withServer trigger = withApplication (app trigger)
50
false
true
0
8
16
51
23
28
null
null
databrary/databrary
src/Model/Party/SQL.hs
agpl-3.0
selectPartyAuthorization :: TH.Name -- ^ 'Identity' -> Selector -- ^ @('Party', Maybe 'Permission')@ selectPartyAuthorization ident = selectJoin 'makePartyAuthorization [ selectParty ident , maybeJoinOn "party.id = authorize_view.child AND authorize_view.parent = 0" $ accessRow "authorize_view" ]
309
selectPartyAuthorization :: TH.Name -- ^ 'Identity' -> Selector selectPartyAuthorization ident = selectJoin 'makePartyAuthorization [ selectParty ident , maybeJoinOn "party.id = authorize_view.child AND authorize_view.parent = 0" $ accessRow "authorize_view" ]
272
selectPartyAuthorization ident = selectJoin 'makePartyAuthorization [ selectParty ident , maybeJoinOn "party.id = authorize_view.child AND authorize_view.parent = 0" $ accessRow "authorize_view" ]
206
true
true
0
7
45
50
24
26
null
null
apyrgio/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
nicModeOvs :: String nicModeOvs = Types.nICModeToRaw NMOvs
58
nicModeOvs :: String nicModeOvs = Types.nICModeToRaw NMOvs
58
nicModeOvs = Types.nICModeToRaw NMOvs
37
false
true
0
6
6
16
8
8
null
null
oldmanmike/ghc
utils/genapply/Main.hs
bsd-3-clause
assign sp (arg : args) regs doc = case findAvailableReg arg regs of Just (reg, regs') -> assign (sp + argSize arg) args regs' ((reg, sp) : doc) Nothing -> (doc, (arg:args), sp)
214
assign sp (arg : args) regs doc = case findAvailableReg arg regs of Just (reg, regs') -> assign (sp + argSize arg) args regs' ((reg, sp) : doc) Nothing -> (doc, (arg:args), sp)
214
assign sp (arg : args) regs doc = case findAvailableReg arg regs of Just (reg, regs') -> assign (sp + argSize arg) args regs' ((reg, sp) : doc) Nothing -> (doc, (arg:args), sp)
214
false
false
0
11
70
100
53
47
null
null
nickbart1980/pandoc
src/Text/Pandoc/Parsing.hs
gpl-2.0
lowercaseRomanDigits :: [Char] lowercaseRomanDigits = ['i','v','x','l','c','d','m']
83
lowercaseRomanDigits :: [Char] lowercaseRomanDigits = ['i','v','x','l','c','d','m']
83
lowercaseRomanDigits = ['i','v','x','l','c','d','m']
52
false
true
0
5
5
35
22
13
null
null
nwf/trifecta
src/Text/Trifecta/Util/Combinators.hs
bsd-3-clause
(<$!>) :: Monad m => (a -> b) -> m a -> m b f <$!> m = do a <- m return $! f a
82
(<$!>) :: Monad m => (a -> b) -> m a -> m b f <$!> m = do a <- m return $! f a
82
f <$!> m = do a <- m return $! f a
38
false
true
0
10
29
68
31
37
null
null
fosskers/mapalgebra
lib/Geography/MapAlgebra.hs
bsd-3-clause
spreadRGBA :: (Index ix, Elevator e) => A.Array S ix (Pixel RGBA e) -> IO (A.Array S ix e, A.Array S ix e, A.Array S ix e, A.Array S ix e) spreadRGBA arr = do let sz = A.size arr mr <- A.unsafeNew sz mb <- A.unsafeNew sz mg <- A.unsafeNew sz ma <- A.unsafeNew sz flip A.imapM_ arr $ \i (PixelRGBA r g b a...
614
spreadRGBA :: (Index ix, Elevator e) => A.Array S ix (Pixel RGBA e) -> IO (A.Array S ix e, A.Array S ix e, A.Array S ix e, A.Array S ix e) spreadRGBA arr = do let sz = A.size arr mr <- A.unsafeNew sz mb <- A.unsafeNew sz mg <- A.unsafeNew sz ma <- A.unsafeNew sz flip A.imapM_ arr $ \i (PixelRGBA r g b a...
614
spreadRGBA arr = do let sz = A.size arr mr <- A.unsafeNew sz mb <- A.unsafeNew sz mg <- A.unsafeNew sz ma <- A.unsafeNew sz flip A.imapM_ arr $ \i (PixelRGBA r g b a) -> do A.unsafeWrite mr i r A.unsafeWrite mg i g A.unsafeWrite mb i b A.unsafeWrite ma i a ar <- A.unsafeFreeze (getComp arr...
471
false
true
0
12
155
346
159
187
null
null
owst/NFAToDFA
src/Math/Automata/Simple.hs
bsd-3-clause
textToNFA :: Text -> Either String (NFA Text Text) textToNFA = (nfaDefToNFA <$>) . doParse where doParse = showLeft . parse parseNFADef "" showLeft = either (Left . show) Right -- |Convert a NFADef into a NFA. At this stage, duplicate states/transitions -- are removed.
280
textToNFA :: Text -> Either String (NFA Text Text) textToNFA = (nfaDefToNFA <$>) . doParse where doParse = showLeft . parse parseNFADef "" showLeft = either (Left . show) Right -- |Convert a NFADef into a NFA. At this stage, duplicate states/transitions -- are removed.
280
textToNFA = (nfaDefToNFA <$>) . doParse where doParse = showLeft . parse parseNFADef "" showLeft = either (Left . show) Right -- |Convert a NFADef into a NFA. At this stage, duplicate states/transitions -- are removed.
229
false
true
3
9
55
83
39
44
null
null
forste/haReFork
refactorer/PwPf/Pointfree.hs
bsd-3-clause
pf2Exp APP = nameToExp "app"
28
pf2Exp APP = nameToExp "app"
28
pf2Exp APP = nameToExp "app"
28
false
false
0
5
4
13
5
8
null
null
urv/fixhs
src/Data/FIX/Spec/FIX43.hs
lgpl-2.1
tBasisPxType :: FIXTag tBasisPxType = FIXTag { tName = "BasisPxType" , tnum = 419 , tparser = toFIXChar , arbitraryValue = FIXChar <$> (return 'A') }
162
tBasisPxType :: FIXTag tBasisPxType = FIXTag { tName = "BasisPxType" , tnum = 419 , tparser = toFIXChar , arbitraryValue = FIXChar <$> (return 'A') }
162
tBasisPxType = FIXTag { tName = "BasisPxType" , tnum = 419 , tparser = toFIXChar , arbitraryValue = FIXChar <$> (return 'A') }
139
false
true
0
10
38
51
29
22
null
null
keera-studios/hsQt
Qtc/Gui/QStyleOptionViewItem.hs
bsd-2-clause
setDisplayAlignment :: QStyleOptionViewItem a -> ((Alignment)) -> IO () setDisplayAlignment x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QStyleOptionViewItem_setDisplayAlignment cobj_x0 (toCLong $ qFlags_toInt x1)
219
setDisplayAlignment :: QStyleOptionViewItem a -> ((Alignment)) -> IO () setDisplayAlignment x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QStyleOptionViewItem_setDisplayAlignment cobj_x0 (toCLong $ qFlags_toInt x1)
219
setDisplayAlignment x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> qtc_QStyleOptionViewItem_setDisplayAlignment cobj_x0 (toCLong $ qFlags_toInt x1)
147
false
true
2
9
29
74
35
39
null
null
jkpl/tagenerator
src/TaGenerator/GameEngine.hs
mit
roomAtDirection :: TextAdventure -> Room -> String -> Either String Room roomAtDirection ta room direction = maybeToEither (cantMove direction) (roomAtDirection' ta room direction)
184
roomAtDirection :: TextAdventure -> Room -> String -> Either String Room roomAtDirection ta room direction = maybeToEither (cantMove direction) (roomAtDirection' ta room direction)
184
roomAtDirection ta room direction = maybeToEither (cantMove direction) (roomAtDirection' ta room direction)
111
false
true
0
8
26
56
27
29
null
null
bitemyapp/tf-idf-1
src/Main.hs
mit
filterCorpus :: [String] -> [[String]] filterCorpus = let clean = (map toLower . filter isAlpha) in map clean >>> sort >>> group
136
filterCorpus :: [String] -> [[String]] filterCorpus = let clean = (map toLower . filter isAlpha) in map clean >>> sort >>> group
136
filterCorpus = let clean = (map toLower . filter isAlpha) in map clean >>> sort >>> group
97
false
true
0
11
29
59
30
29
null
null
wavewave/lhc-analysis-collection
exe/2013-08-05-XQLD.hs
gpl-3.0
leptons = [11,13,-11,-13]
25
leptons = [11,13,-11,-13]
25
leptons = [11,13,-11,-13]
25
false
false
1
6
2
25
13
12
null
null
olsner/ghc
compiler/rename/RnBinds.hs
bsd-3-clause
rnLocalBindsAndThen (HsIPBinds binds) thing_inside = do (binds',fv_binds) <- rnIPBinds binds (thing, fvs_thing) <- thing_inside (HsIPBinds binds') fv_binds return (thing, fvs_thing `plusFV` fv_binds)
211
rnLocalBindsAndThen (HsIPBinds binds) thing_inside = do (binds',fv_binds) <- rnIPBinds binds (thing, fvs_thing) <- thing_inside (HsIPBinds binds') fv_binds return (thing, fvs_thing `plusFV` fv_binds)
211
rnLocalBindsAndThen (HsIPBinds binds) thing_inside = do (binds',fv_binds) <- rnIPBinds binds (thing, fvs_thing) <- thing_inside (HsIPBinds binds') fv_binds return (thing, fvs_thing `plusFV` fv_binds)
211
false
false
0
10
33
75
38
37
null
null
sdiehl/ghc
testsuite/tests/programs/galois_raytrace/Eval.hs
bsd-3-clause
-- Rule 7 & 8: If statement step st@(State{ env = env, stack = (VClosure e2 c2):(VClosure e1 c1):(VBool True):stack, code = TIf:cs }) = do { stk <- eval (State {env = e1, stack = stack, code = c1}) ; return (st { stack = stk, code = cs }) }
252
step st@(State{ env = env, stack = (VClosure e2 c2):(VClosure e1 c1):(VBool True):stack, code = TIf:cs }) = do { stk <- eval (State {env = e1, stack = stack, code = c1}) ; return (st { stack = stk, code = cs }) }
224
step st@(State{ env = env, stack = (VClosure e2 c2):(VClosure e1 c1):(VBool True):stack, code = TIf:cs }) = do { stk <- eval (State {env = e1, stack = stack, code = c1}) ; return (st { stack = stk, code = cs }) }
224
true
false
17
12
63
142
76
66
null
null
brendanhay/gogol
gogol-deploymentmanager/gen/Network/Google/Resource/DeploymentManager/Deployments/Update.hs
mpl-2.0
-- | Multipart request metadata. duPayload :: Lens' DeploymentsUpdate Deployment duPayload = lens _duPayload (\ s a -> s{_duPayload = a})
139
duPayload :: Lens' DeploymentsUpdate Deployment duPayload = lens _duPayload (\ s a -> s{_duPayload = a})
106
duPayload = lens _duPayload (\ s a -> s{_duPayload = a})
58
true
true
1
9
22
46
22
24
null
null
jeremy-w/Idris-dev
src/Idris/Core/ProofState.hs
bsd-3-clause
dropGiven du (u@(n, _) : us) hs | n `elem` du = dropGiven du us hs
69
dropGiven du (u@(n, _) : us) hs | n `elem` du = dropGiven du us hs
69
dropGiven du (u@(n, _) : us) hs | n `elem` du = dropGiven du us hs
69
false
false
0
9
18
48
25
23
null
null
nickbart1980/pandoc
src/Text/Pandoc/Writers/FB2.hs
gpl-2.0
-- FIXME plain (Code _ s) = s
29
plain (Code _ s) = s
20
plain (Code _ s) = s
20
true
false
0
7
7
18
9
9
null
null
jkozlowski/kdb-haskell
src/Database/Kdb/Internal/IPC.hs
mit
-- Adapted from attoparsec-binary. cchar8 :: A.Parser CChar cchar8 = fromIntegral <$> A.anyWord8
97
cchar8 :: A.Parser CChar cchar8 = fromIntegral <$> A.anyWord8
61
cchar8 = fromIntegral <$> A.anyWord8
36
true
true
1
7
13
27
12
15
null
null
gergoerdi/kansas-lava-papilio
src/Hardware/KansasLava/SevenSegment.hs
bsd-3-clause
encodeHexSS :: Unsigned X4 -> Matrix X7 Bool encodeHexSS n = matrix $ case n of -- a b c d e f g 0x0 -> [ True, True, True, True, True, True, False ] 0x1 -> [ False, True, True, False, False, False, False ] 0x2 -> [ True, True, False, True, True, False, ...
1,161
encodeHexSS :: Unsigned X4 -> Matrix X7 Bool encodeHexSS n = matrix $ case n of -- a b c d e f g 0x0 -> [ True, True, True, True, True, True, False ] 0x1 -> [ False, True, True, False, False, False, False ] 0x2 -> [ True, True, False, True, True, False, ...
1,161
encodeHexSS n = matrix $ case n of -- a b c d e f g 0x0 -> [ True, True, True, True, True, True, False ] 0x1 -> [ False, True, True, False, False, False, False ] 0x2 -> [ True, True, False, True, True, False, True ] 0x3 -> [ True, True, True, Tru...
1,116
false
true
16
6
386
499
290
209
null
null
cl04/advent2016
src/Day5.hs
bsd-3-clause
next' r i s | not ("00000" `isPrefixOf` msg) = next' r (1+i) s | IntMap.size r == 8 = r | pos `IntMap.member` r || pos >= 8 = next' r (1+i) s | pos `IntMap.notMember` r = next' (IntMap.insert pos ch r) (1+i) s where t = C.concat [s, pad, C.pack (show i)] pad = C.replicate (5 - numDigits i) '0' h ...
435
next' r i s | not ("00000" `isPrefixOf` msg) = next' r (1+i) s | IntMap.size r == 8 = r | pos `IntMap.member` r || pos >= 8 = next' r (1+i) s | pos `IntMap.notMember` r = next' (IntMap.insert pos ch r) (1+i) s where t = C.concat [s, pad, C.pack (show i)] pad = C.replicate (5 - numDigits i) '0' h ...
435
next' r i s | not ("00000" `isPrefixOf` msg) = next' r (1+i) s | IntMap.size r == 8 = r | pos `IntMap.member` r || pos >= 8 = next' r (1+i) s | pos `IntMap.notMember` r = next' (IntMap.insert pos ch r) (1+i) s where t = C.concat [s, pad, C.pack (show i)] pad = C.replicate (5 - numDigits i) '0' h ...
435
false
false
6
10
124
296
139
157
null
null
mrkkrp/stack
src/Stack/Constants.hs
bsd-3-clause
-- | Name of the 'stack' program. stackProgName :: String stackProgName = "stack"
81
stackProgName :: String stackProgName = "stack"
47
stackProgName = "stack"
23
true
true
0
4
12
12
7
5
null
null
jqpeterson/roc-translator
src/Protocol/ROC/Float.hs
bsd-3-clause
getIeeeFloat32 :: Get Float getIeeeFloat32 = do raw <- getWord32be return $ rocFloatToFloat raw
100
getIeeeFloat32 :: Get Float getIeeeFloat32 = do raw <- getWord32be return $ rocFloatToFloat raw
100
getIeeeFloat32 = do raw <- getWord32be return $ rocFloatToFloat raw
72
false
true
0
9
18
37
15
22
null
null
jystic/netcdf-hs
src/Data/NetCDF/Serialize.hs
bsd-3-clause
------------------------------------------------------------------------ -- | Parse the header of a NetCDF file. getHeader :: Get Header getHeader = do string "CDF" format <- pure FormatClassic <* word8 1 <|> pure Format64Bit <* word8 2 <?> "file format" numrecs <- pure Streaming <*...
617
getHeader :: Get Header getHeader = do string "CDF" format <- pure FormatClassic <* word8 1 <|> pure Format64Bit <* word8 2 <?> "file format" numrecs <- pure Streaming <* word32be 0xFFFFFFFF <|> NumRecs <$> getWord32be dims <- getDimensionList gatts <- getAttribu...
503
getHeader = do string "CDF" format <- pure FormatClassic <* word8 1 <|> pure Format64Bit <* word8 2 <?> "file format" numrecs <- pure Streaming <* word32be 0xFFFFFFFF <|> NumRecs <$> getWord32be dims <- getDimensionList gatts <- getAttributeList vars <- getV...
479
true
true
0
12
146
135
61
74
null
null
slpopejoy/fadno-xml
src/Fadno/MusicXml/MusicXml20.hs
bsd-2-clause
parseLyricFont :: P.XParse LyricFont parseLyricFont = LyricFont <$> P.optional (P.xattr (P.name "number") >>= parseNMTOKEN) <*> P.optional (P.xattr (P.name "name") >>= parseToken) <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText) <*> P.optional (P.xattr (...
508
parseLyricFont :: P.XParse LyricFont parseLyricFont = LyricFont <$> P.optional (P.xattr (P.name "number") >>= parseNMTOKEN) <*> P.optional (P.xattr (P.name "name") >>= parseToken) <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText) <*> P.optional (P.xattr (...
508
parseLyricFont = LyricFont <$> P.optional (P.xattr (P.name "number") >>= parseNMTOKEN) <*> P.optional (P.xattr (P.name "name") >>= parseToken) <*> P.optional (P.xattr (P.name "font-family") >>= parseCommaSeparatedText) <*> P.optional (P.xattr (P.name "font-style") >>= parseFontSty...
471
false
true
17
11
103
212
103
109
null
null
mikeyhc/kainbot
src/Kain/Internal.hs
bsd-3-clause
runKainHandlerT :: (Monad m) => B.ByteString -> B.ByteString -> B.ByteString -> B.ByteString -> KainHandlerT m a -> KainT m a runKainHandlerT nick user chan msg (KainHandlerT s) = do state <- get (ret, rs) <- runStateT s (KainHandlerState nick user chan msg state) put $ _kainHandlerKain rs ...
333
runKainHandlerT :: (Monad m) => B.ByteString -> B.ByteString -> B.ByteString -> B.ByteString -> KainHandlerT m a -> KainT m a runKainHandlerT nick user chan msg (KainHandlerT s) = do state <- get (ret, rs) <- runStateT s (KainHandlerState nick user chan msg state) put $ _kainHandlerKain rs ...
333
runKainHandlerT nick user chan msg (KainHandlerT s) = do state <- get (ret, rs) <- runStateT s (KainHandlerState nick user chan msg state) put $ _kainHandlerKain rs return ret
191
false
true
0
14
80
135
63
72
null
null
acfoltzer/RazorsLambda
src/RazorsLambda/Eval.hs
bsd-3-clause
evalDecl :: Decl -> Eval Value evalDecl (Decl x args _ e) = do let e' = foldr (\(y, t) e'' -> ELam y t e'') e args rec v <- localEnv (Map.insert x v) (evalExpr e') return v
178
evalDecl :: Decl -> Eval Value evalDecl (Decl x args _ e) = do let e' = foldr (\(y, t) e'' -> ELam y t e'') e args rec v <- localEnv (Map.insert x v) (evalExpr e') return v
178
evalDecl (Decl x args _ e) = do let e' = foldr (\(y, t) e'' -> ELam y t e'') e args rec v <- localEnv (Map.insert x v) (evalExpr e') return v
147
false
true
0
13
44
109
52
57
null
null
johnbcoughlin/mucalc
src/GRSynth/GameStructure.hs
gpl-2.0
withPropAsSupport :: (State x, State y) => GS x y -> String -> [(x, y)] -> GS x y withPropAsSupport gs label xys = let pProp = fromExplicit (map encode xys) in gs { gsprops = M.insert label pProp (gsprops gs) }
244
withPropAsSupport :: (State x, State y) => GS x y -> String -> [(x, y)] -> GS x y withPropAsSupport gs label xys = let pProp = fromExplicit (map encode xys) in gs { gsprops = M.insert label pProp (gsprops gs) }
244
withPropAsSupport gs label xys = let pProp = fromExplicit (map encode xys) in gs { gsprops = M.insert label pProp (gsprops gs) }
162
false
true
0
11
75
109
55
54
null
null
sdiehl/ghc
compiler/typecheck/TcGenFunctor.hs
bsd-3-clause
bs_Vars = map nlHsVar bs_RDRs
29
bs_Vars = map nlHsVar bs_RDRs
29
bs_Vars = map nlHsVar bs_RDRs
29
false
false
1
5
4
14
5
9
null
null
Icelandjack/lens
src/Control/Lens/Iso.hs
bsd-3-clause
-- | An 'Iso' between a list, 'ByteString', 'Text' fragment, etc. and its reversal. -- -- >>> "live" ^. reversed -- "evil" -- -- >>> "live" & reversed %~ ('d':) -- "lived" reversed :: Reversing a => Iso' a a reversed = involuted Iso.reversing
242
reversed :: Reversing a => Iso' a a reversed = involuted Iso.reversing
70
reversed = involuted Iso.reversing
34
true
true
0
6
43
35
20
15
null
null
pparkkin/eta
compiler/ETA/CodeGen/Prim.hs
bsd-3-clause
simpleOp IntLeOp = Just $ intCompOp if_icmple
45
simpleOp IntLeOp = Just $ intCompOp if_icmple
45
simpleOp IntLeOp = Just $ intCompOp if_icmple
45
false
false
0
6
6
16
7
9
null
null
kevinjardine/gruzeSnaplet
src/Snap/Snaplet/Gruze/Box.hs
gpl-2.0
setStringList :: GrzAtomBoxClass c => GrzKey -> [GrzString] -> c -> c setStringList k ss c = setAtomList k (map stringToAtom ss) c
130
setStringList :: GrzAtomBoxClass c => GrzKey -> [GrzString] -> c -> c setStringList k ss c = setAtomList k (map stringToAtom ss) c
130
setStringList k ss c = setAtomList k (map stringToAtom ss) c
60
false
true
0
8
22
55
27
28
null
null
markflorisson/hpack
testrepo/bytestring-0.9.1.9/Data/ByteString/Unsafe.hs
bsd-3-clause
-- | /O(n)/ Pack a null-terminated sequence of bytes, pointed to by an -- Addr\# (an arbitrary machine address assumed to point outside the -- garbage-collected heap) into a @ByteString@. A much faster way to -- create an Addr\# is with an unboxed string literal, than to pack a -- boxed string. A unboxed string literal...
1,222
unsafePackAddress :: Addr# -> IO ByteString unsafePackAddress addr# = do p <- newForeignPtr_ (castPtr cstr) l <- c_strlen cstr return $ PS p 0 (fromIntegral l) where cstr :: CString cstr = Ptr addr#
221
unsafePackAddress addr# = do p <- newForeignPtr_ (castPtr cstr) l <- c_strlen cstr return $ PS p 0 (fromIntegral l) where cstr :: CString cstr = Ptr addr#
177
true
true
0
10
229
104
59
45
null
null
avh4/elm-compiler
src/Transform/Canonicalize/Variable.hs
bsd-3-clause
preferLocals' :: Environment -> (a -> Var.Canonical) -> String -> [a] -> String -> Canonicalizer String a preferLocals' env extract kind possibilities var = case filter (isLocal . extract) possibilities of [] -> ambiguous possibilities [v] -> found extract v locals -> ambiguou...
850
preferLocals' :: Environment -> (a -> Var.Canonical) -> String -> [a] -> String -> Canonicalizer String a preferLocals' env extract kind possibilities var = case filter (isLocal . extract) possibilities of [] -> ambiguous possibilities [v] -> found extract v locals -> ambiguou...
850
preferLocals' env extract kind possibilities var = case filter (isLocal . extract) possibilities of [] -> ambiguous possibilities [v] -> found extract v locals -> ambiguous locals where isLocal :: Var.Canonical -> Bool isLocal (Var.Canonical home _) = case home of ...
730
false
true
0
14
293
248
123
125
null
null
nushio3/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
-- | Does a type represent a floating-point number? isFloatingTy :: Type -> Bool isFloatingTy ty = isFloatTy ty || isDoubleTy ty
128
isFloatingTy :: Type -> Bool isFloatingTy ty = isFloatTy ty || isDoubleTy ty
76
isFloatingTy ty = isFloatTy ty || isDoubleTy ty
47
true
true
0
7
21
34
15
19
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxLIST_MASK_FORMAT :: Int wxLIST_MASK_FORMAT = 32
49
wxLIST_MASK_FORMAT :: Int wxLIST_MASK_FORMAT = 32
49
wxLIST_MASK_FORMAT = 32
23
false
true
0
4
5
11
6
5
null
null
dbp/karamaan-opaleye
Karamaan/Opaleye/Operators/Numeric.hs
bsd-3-clause
-- It's also unclear what types these operations should have -- Should there be a Num typeclass constraint or similar? plus :: NumBinOpH a a plus = opArr OpPlus "plus"
167
plus :: NumBinOpH a a plus = opArr OpPlus "plus"
48
plus = opArr OpPlus "plus"
26
true
true
0
5
29
23
12
11
null
null
nevrenato/Hets_Fork
HasCASL/ClassAna.hs
gpl-2.0
minRawKind :: Monad m => String -> RawKind -> RawKind -> m RawKind minRawKind str k1 k2 = let err = fail $ diffKindString str k1 k2 in case k1 of ClassKind _ -> case k2 of ClassKind _ -> return $ ClassKind () _ -> err FunKind v1 a1 r1 ps -> case k2 of FunKind v2 a2 r2 qs -> do ...
476
minRawKind :: Monad m => String -> RawKind -> RawKind -> m RawKind minRawKind str k1 k2 = let err = fail $ diffKindString str k1 k2 in case k1 of ClassKind _ -> case k2 of ClassKind _ -> return $ ClassKind () _ -> err FunKind v1 a1 r1 ps -> case k2 of FunKind v2 a2 r2 qs -> do ...
476
minRawKind str k1 k2 = let err = fail $ diffKindString str k1 k2 in case k1 of ClassKind _ -> case k2 of ClassKind _ -> return $ ClassKind () _ -> err FunKind v1 a1 r1 ps -> case k2 of FunKind v2 a2 r2 qs -> do a3 <- minRawKind str a2 a1 r3 <- minRawKind str r1 r2...
409
false
true
0
22
165
204
93
111
null
null
zaxtax/hakaru
haskell/Language/Hakaru/Parser/Parser.hs
bsd-3-clause
product_expr :: Parser (AST' Text) product_expr = reserved "product" *> (Product <$> identifier <* symbol "from" <*> expr <* symbol "to" <*> expr <*> semiblockExpr )
231
product_expr :: Parser (AST' Text) product_expr = reserved "product" *> (Product <$> identifier <* symbol "from" <*> expr <* symbol "to" <*> expr <*> semiblockExpr )
231
product_expr = reserved "product" *> (Product <$> identifier <* symbol "from" <*> expr <* symbol "to" <*> expr <*> semiblockExpr )
196
false
true
2
12
91
63
30
33
null
null
lukemaurer/sequent-core
src/Language/SequentCore/Driver.hs
bsd-3-clause
pprSeqCoreToDo (SeqCoreDoContify cs) = text "Contify" <+> parens (ppr cs)
75
pprSeqCoreToDo (SeqCoreDoContify cs) = text "Contify" <+> parens (ppr cs)
75
pprSeqCoreToDo (SeqCoreDoContify cs) = text "Contify" <+> parens (ppr cs)
75
false
false
0
8
11
31
14
17
null
null
ghc-android/ghc
compiler/basicTypes/OccName.hs
bsd-3-clause
isDataSymOcc _ = False
41
isDataSymOcc _ = False
41
isDataSymOcc _ = False
41
false
false
0
5
22
9
4
5
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_INT_IMAGE_2D_MULTISAMPLE :: GLenum gl_INT_IMAGE_2D_MULTISAMPLE = 0x9060
74
gl_INT_IMAGE_2D_MULTISAMPLE :: GLenum gl_INT_IMAGE_2D_MULTISAMPLE = 0x9060
74
gl_INT_IMAGE_2D_MULTISAMPLE = 0x9060
36
false
true
0
4
5
11
6
5
null
null
mhwombat/exp-uivector-cluster-wains
src/ALife/Creatur/Wain/UIVector/Cluster/Universe.hs
bsd-3-clause
cPopControl :: Setting Bool cPopControl = requiredSetting "popControl"
70
cPopControl :: Setting Bool cPopControl = requiredSetting "popControl"
70
cPopControl = requiredSetting "popControl"
42
false
true
0
6
7
22
9
13
null
null
Blaisorblade/learning-syntactic
src/Sec7UndecidableInstances.hs
mit
optAddDefault ∷ (OptAdd dom dom, sym :<: dom) ⇒ sym a → Args (AST dom) a → AST dom (Full (Result a)) optAddDefault s = appArgs (Sym (inj s)) . mapArgs optAdd
159
optAddDefault ∷ (OptAdd dom dom, sym :<: dom) ⇒ sym a → Args (AST dom) a → AST dom (Full (Result a)) optAddDefault s = appArgs (Sym (inj s)) . mapArgs optAdd
159
optAddDefault s = appArgs (Sym (inj s)) . mapArgs optAdd
56
false
true
0
13
33
95
45
50
null
null
tolysz/hs-tls
core/Network/TLS/State.hs
bsd-3-clause
certVerifyHandshakeTypeMaterial HandshakeType_CertVerify = False
69
certVerifyHandshakeTypeMaterial HandshakeType_CertVerify = False
69
certVerifyHandshakeTypeMaterial HandshakeType_CertVerify = False
69
false
false
0
5
8
9
4
5
null
null
acowley/ghc
compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs
bsd-3-clause
trivColorable platform virtualRegSqueeze realRegSqueeze RcFloat conflicts exclusions | let cALLOCATABLE_REGS_FLOAT = (case platformArch platform of ArchX86 -> 0 ArchX86_64 -> 0 ArchPPC -> ...
1,380
trivColorable platform virtualRegSqueeze realRegSqueeze RcFloat conflicts exclusions | let cALLOCATABLE_REGS_FLOAT = (case platformArch platform of ArchX86 -> 0 ArchX86_64 -> 0 ArchPPC -> ...
1,380
trivColorable platform virtualRegSqueeze realRegSqueeze RcFloat conflicts exclusions | let cALLOCATABLE_REGS_FLOAT = (case platformArch platform of ArchX86 -> 0 ArchX86_64 -> 0 ArchPPC -> ...
1,380
false
false
0
15
670
197
91
106
null
null
byorgey/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
process fn (LogLvl i) = setLogLevel i
37
process fn (LogLvl i) = setLogLevel i
37
process fn (LogLvl i) = setLogLevel i
37
false
false
0
7
6
20
9
11
null
null