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
michaelgwelch/bacnet
src/BACnet/Tag/Writer.hs
mit
writeTimeAPTag :: Writer writeTimeAPTag = unsigned8 0xB4
56
writeTimeAPTag :: Writer writeTimeAPTag = unsigned8 0xB4
56
writeTimeAPTag = unsigned8 0xB4
31
false
true
0
6
6
21
8
13
null
null
ilyasergey/GHC-XAppFix
compiler/nativeGen/PPC/Ppr.hs
bsd-3-clause
pprImm platform (ImmCLbl l) = pprCLabel_asm platform l
57
pprImm platform (ImmCLbl l) = pprCLabel_asm platform l
57
pprImm platform (ImmCLbl l) = pprCLabel_asm platform l
57
false
false
0
6
10
24
10
14
null
null
geophf/1HaskellADay
exercises/HAD/Y2017/M10/D03/Solution.hs
mit
archive :: Part -> FilePath archive x = "Y2017/M10/D03/NYTOnline_09-05-17_09-10-17_ALLSecs-pt" ++ show x ++ ".txt.gz"
120
archive :: Part -> FilePath archive x = "Y2017/M10/D03/NYTOnline_09-05-17_09-10-17_ALLSecs-pt" ++ show x ++ ".txt.gz"
120
archive x = "Y2017/M10/D03/NYTOnline_09-05-17_09-10-17_ALLSecs-pt" ++ show x ++ ".txt.gz"
92
false
true
0
7
16
35
15
20
null
null
nevvi/Declarative-D7012E
lab2/Parser.hs
gpl-3.0
(#-) :: Parser a -> Parser b -> Parser a m #- n = (m # n) >-> fst
65
(#-) :: Parser a -> Parser b -> Parser a m #- n = (m # n) >-> fst
65
m #- n = (m # n) >-> fst
24
false
true
0
9
18
47
23
24
null
null
Laar/opengl-xmlspec
src/Text/OpenGL/Xml/CProcess.hs
bsd-3-clause
pTypeDef :: String -> Either String TypeDef pTypeDef s = do d <- parseC' s pAlias d <|> pFuncDef d <|> pStructDef d <|> Left ("Typedef parsing failed for:" ++ s)
178
pTypeDef :: String -> Either String TypeDef pTypeDef s = do d <- parseC' s pAlias d <|> pFuncDef d <|> pStructDef d <|> Left ("Typedef parsing failed for:" ++ s)
178
pTypeDef s = do d <- parseC' s pAlias d <|> pFuncDef d <|> pStructDef d <|> Left ("Typedef parsing failed for:" ++ s)
134
false
true
0
10
47
67
30
37
null
null
tomjefferys/fuligite
src/Scripting/Fuligite/GarbageCollector.hs
mit
setupGCState :: EvalMonad2 GCState setupGCState = do objs <- IdCache.allIds . objCache <$> get let gcState = newGCState objs eids <- getEnvId <$> get return $ foldr moveToGrey gcState eids -- Examines all the current grey objects
239
setupGCState :: EvalMonad2 GCState setupGCState = do objs <- IdCache.allIds . objCache <$> get let gcState = newGCState objs eids <- getEnvId <$> get return $ foldr moveToGrey gcState eids -- Examines all the current grey objects
239
setupGCState = do objs <- IdCache.allIds . objCache <$> get let gcState = newGCState objs eids <- getEnvId <$> get return $ foldr moveToGrey gcState eids -- Examines all the current grey objects
204
false
true
0
10
46
69
32
37
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_MARK_LCORNER :: Int wxSTC_MARK_LCORNER = 10
49
wxSTC_MARK_LCORNER :: Int wxSTC_MARK_LCORNER = 10
49
wxSTC_MARK_LCORNER = 10
23
false
true
0
6
5
18
7
11
null
null
mrmonday/Idris-dev
src/IRTS/Exports.hs
bsd-3-clause
toFDesc :: Term -> FDesc toFDesc (Constant (Str str)) = FStr str
64
toFDesc :: Term -> FDesc toFDesc (Constant (Str str)) = FStr str
64
toFDesc (Constant (Str str)) = FStr str
39
false
true
0
11
11
38
17
21
null
null
jystic/quick-version
src/Main.hs
bsd-3-clause
------------------------------------------------------------------------ printPackageExports :: G.PackageId -> IO () printPackageExports pkgId = do p <- withGhc (getPackage pkgId) putStrLn (showPackage p)
213
printPackageExports :: G.PackageId -> IO () printPackageExports pkgId = do p <- withGhc (getPackage pkgId) putStrLn (showPackage p)
139
printPackageExports pkgId = do p <- withGhc (getPackage pkgId) putStrLn (showPackage p)
95
true
true
0
10
27
54
25
29
null
null
alpmestan/core-server
client.hs
bsd-3-clause
readTilEmpty :: Handle -> IO B.ByteString readTilEmpty h = go where go = do eof <- hIsEOF h if eof then return B.empty else do b <- hReady h if b then do ...
502
readTilEmpty :: Handle -> IO B.ByteString readTilEmpty h = go where go = do eof <- hIsEOF h if eof then return B.empty else do b <- hReady h if b then do ...
502
readTilEmpty h = go where go = do eof <- hIsEOF h if eof then return B.empty else do b <- hReady h if b then do s <- B.hGetNonBlocking h (1024*500) ...
460
false
true
1
17
303
134
61
73
null
null
z0isch/htak
src/Tak/Printer/PTN.hs
bsd-3-clause
printMove (Left Draw) = "1/2-1/2"
33
printMove (Left Draw) = "1/2-1/2"
33
printMove (Left Draw) = "1/2-1/2"
33
false
false
0
7
4
15
7
8
null
null
hesiod/OpenGL
src/Graphics/Rendering/OpenGL/GL/Polygons.hs
bsd-3-clause
polygonOffset :: StateVar (GLfloat, GLfloat) polygonOffset = makeStateVar (liftM2 (,) (getFloat1 id GetPolygonOffsetFactor) (getFloat1 id GetPolygonOffsetUnits)) (uncurry glPolygonOffset)
234
polygonOffset :: StateVar (GLfloat, GLfloat) polygonOffset = makeStateVar (liftM2 (,) (getFloat1 id GetPolygonOffsetFactor) (getFloat1 id GetPolygonOffsetUnits)) (uncurry glPolygonOffset)
234
polygonOffset = makeStateVar (liftM2 (,) (getFloat1 id GetPolygonOffsetFactor) (getFloat1 id GetPolygonOffsetUnits)) (uncurry glPolygonOffset)
189
false
true
0
9
64
60
31
29
null
null
facebookincubator/duckling
Duckling/Time/NB/Rules.hs
bsd-3-clause
ruleDayofmonthordinalNamedmonthYear :: Rule ruleDayofmonthordinalNamedmonthYear = Rule { name = "<day-of-month>(ordinal) <named-month> year" , pattern = [ Predicate isDOMOrdinal , Predicate isAMonth , regex "(\\d{2,4})" ] , prod = \tokens -> case tokens of (token: Token Time td: ...
515
ruleDayofmonthordinalNamedmonthYear :: Rule ruleDayofmonthordinalNamedmonthYear = Rule { name = "<day-of-month>(ordinal) <named-month> year" , pattern = [ Predicate isDOMOrdinal , Predicate isAMonth , regex "(\\d{2,4})" ] , prod = \tokens -> case tokens of (token: Token Time td: ...
515
ruleDayofmonthordinalNamedmonthYear = Rule { name = "<day-of-month>(ordinal) <named-month> year" , pattern = [ Predicate isDOMOrdinal , Predicate isAMonth , regex "(\\d{2,4})" ] , prod = \tokens -> case tokens of (token: Token Time td: Token RegexMatch (GroupMatch (match:_)): ...
471
false
true
0
20
147
155
77
78
null
null
andrew-quinn/mm
mm.hs
mit
masser (Element a n) = fromIntegral n * amu a where amu = realFracToDecimal precision . atomWeight . elementBySymbol
118
masser (Element a n) = fromIntegral n * amu a where amu = realFracToDecimal precision . atomWeight . elementBySymbol
118
masser (Element a n) = fromIntegral n * amu a where amu = realFracToDecimal precision . atomWeight . elementBySymbol
118
false
false
0
7
20
46
21
25
null
null
np/hlatex
examples/ds/Kit.hs
bsd-3-clause
rawMathLatexItem = B.math . BI.rawMath
38
rawMathLatexItem = B.math . BI.rawMath
38
rawMathLatexItem = B.math . BI.rawMath
38
false
false
0
6
4
14
7
7
null
null
brendanhay/gogol
gogol-spanner/gen/Network/Google/Spanner/Types/Product.hs
mpl-2.0
-- | Creates a value of 'MetricIndexedHotKeys' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'mihkAddtional' metricIndexedHotKeys :: HashMap Text IndexedHotKey -- ^ 'mihkAddtional' -> MetricIndexedHotKeys metricIndexedHotKeys...
407
metricIndexedHotKeys :: HashMap Text IndexedHotKey -- ^ 'mihkAddtional' -> MetricIndexedHotKeys metricIndexedHotKeys pMihkAddtional_ = MetricIndexedHotKeys' {_mihkAddtional = _Coerce # pMihkAddtional_}
211
metricIndexedHotKeys pMihkAddtional_ = MetricIndexedHotKeys' {_mihkAddtional = _Coerce # pMihkAddtional_}
107
true
true
0
8
62
50
26
24
null
null
facebookincubator/duckling
Duckling/Numeral/MN/Corpus.hs
bsd-3-clause
corpus :: Corpus corpus = (context, testOptions, allExamples)
61
corpus :: Corpus corpus = (context, testOptions, allExamples)
61
corpus = (context, testOptions, allExamples)
44
false
true
0
5
7
20
12
8
null
null
ekmett/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprInstr g@(GSUB _ src1 src2 dst) | src1 == dst = pprG g (text "\t#GSUB-xxxcase1" $$ hcat [gtab, gpush src2 0, text " ; fsubrp %st(0),", greg src1 1]) | src2 == dst = pprG g (text "\t#GSUB-xxxcase2" $$ hcat [gtab, gpush src1 0, text " ; fsubp %...
500
pprInstr g@(GSUB _ src1 src2 dst) | src1 == dst = pprG g (text "\t#GSUB-xxxcase1" $$ hcat [gtab, gpush src2 0, text " ; fsubrp %st(0),", greg src1 1]) | src2 == dst = pprG g (text "\t#GSUB-xxxcase2" $$ hcat [gtab, gpush src1 0, text " ; fsubp %...
500
pprInstr g@(GSUB _ src1 src2 dst) | src1 == dst = pprG g (text "\t#GSUB-xxxcase1" $$ hcat [gtab, gpush src2 0, text " ; fsubrp %st(0),", greg src1 1]) | src2 == dst = pprG g (text "\t#GSUB-xxxcase2" $$ hcat [gtab, gpush src1 0, text " ; fsubp %...
500
false
false
1
11
195
197
96
101
null
null
supki/libstackexchange
examples/server-side-authentication.hs
mit
main ∷ IO () main = do tokens ← newIORef [] simpleHTTP nullConf $ msum [ dir "authenticate-me-please" $ seeOther (render $ explicitUserPermission cID rURI) "" , dir "save-token" $ do c ← lookText "code" liftIO $ askSE (explicitAccessToken cID cSecret c rURI) >>= modifyIORef' tokens . (:) ...
476
main ∷ IO () main = do tokens ← newIORef [] simpleHTTP nullConf $ msum [ dir "authenticate-me-please" $ seeOther (render $ explicitUserPermission cID rURI) "" , dir "save-token" $ do c ← lookText "code" liftIO $ askSE (explicitAccessToken cID cSecret c rURI) >>= modifyIORef' tokens . (:) ...
476
main = do tokens ← newIORef [] simpleHTTP nullConf $ msum [ dir "authenticate-me-please" $ seeOther (render $ explicitUserPermission cID rURI) "" , dir "save-token" $ do c ← lookText "code" liftIO $ askSE (explicitAccessToken cID cSecret c rURI) >>= modifyIORef' tokens . (:) ok "Save...
463
false
true
0
18
124
174
82
92
null
null
rgaiacs/pandoc
src/Text/Pandoc/Writers/HTML.hs
gpl-2.0
toList :: (Html -> Html) -> WriterOptions -> ([Html] -> Html) toList listop opts items = do if (writerIncremental opts) then if (writerSlideVariant opts /= RevealJsSlides) then (listop $ mconcat items) ! A.class_ "incremental" else listop $ mconcat $ map (! A.class_ "fragment") ...
360
toList :: (Html -> Html) -> WriterOptions -> ([Html] -> Html) toList listop opts items = do if (writerIncremental opts) then if (writerSlideVariant opts /= RevealJsSlides) then (listop $ mconcat items) ! A.class_ "incremental" else listop $ mconcat $ map (! A.class_ "fragment") ...
360
toList listop opts items = do if (writerIncremental opts) then if (writerSlideVariant opts /= RevealJsSlides) then (listop $ mconcat items) ! A.class_ "incremental" else listop $ mconcat $ map (! A.class_ "fragment") items else listop $ mconcat items
298
false
true
0
13
96
126
65
61
null
null
robeverest/accelerate
Data/Array/Accelerate/Interpreter.hs
bsd-3-clause
evalPreOpenAcc (Foreign _ _ _) _ = error "This case is not possible"
70
evalPreOpenAcc (Foreign _ _ _) _ = error "This case is not possible"
70
evalPreOpenAcc (Foreign _ _ _) _ = error "This case is not possible"
70
false
false
0
7
14
24
11
13
null
null
Javran/twitter-conduit
sample/oslist.hs
bsd-2-clause
main :: IO () main = do [screenName] <- getArgs twInfo <- getTWInfoFromEnv mgr <- newManager tlsManagerSettings let sn = ScreenNameParam screenName folids <- runConduit $ sourceWithCursor twInfo mgr (followersIds sn) .| CL.consume friids <- runConduit $ sourceWithCursor twInfo mgr (friendsIds s...
596
main :: IO () main = do [screenName] <- getArgs twInfo <- getTWInfoFromEnv mgr <- newManager tlsManagerSettings let sn = ScreenNameParam screenName folids <- runConduit $ sourceWithCursor twInfo mgr (followersIds sn) .| CL.consume friids <- runConduit $ sourceWithCursor twInfo mgr (friendsIds s...
596
main = do [screenName] <- getArgs twInfo <- getTWInfoFromEnv mgr <- newManager tlsManagerSettings let sn = ScreenNameParam screenName folids <- runConduit $ sourceWithCursor twInfo mgr (followersIds sn) .| CL.consume friids <- runConduit $ sourceWithCursor twInfo mgr (friendsIds sn) .| CL.consu...
582
false
true
0
14
145
220
102
118
null
null
vinnymac/glot-www
Util/Alert.hs
mit
warningText :: Text -> Text warningText = toStrict . renderHtml . warningHtml
77
warningText :: Text -> Text warningText = toStrict . renderHtml . warningHtml
77
warningText = toStrict . renderHtml . warningHtml
49
false
true
1
7
11
30
13
17
null
null
jmikkola/Athena
src/Inference.hs
mit
inferBindGroup :: BindGroup -> Environment -> InferM (TypedDecls, Environment) inferBindGroup bg env = do let expls = explicitBindings bg explicitBindingTypes <- getExplicitTypes expls let env1 = addToEnv explicitBindingTypes env let impls = implicitBindings bg (decls1, env2) <- inferGroups impls env1 let...
411
inferBindGroup :: BindGroup -> Environment -> InferM (TypedDecls, Environment) inferBindGroup bg env = do let expls = explicitBindings bg explicitBindingTypes <- getExplicitTypes expls let env1 = addToEnv explicitBindingTypes env let impls = implicitBindings bg (decls1, env2) <- inferGroups impls env1 let...
411
inferBindGroup bg env = do let expls = explicitBindings bg explicitBindingTypes <- getExplicitTypes expls let env1 = addToEnv explicitBindingTypes env let impls = implicitBindings bg (decls1, env2) <- inferGroups impls env1 let env' = addToEnv env2 env1 decls2 <- tiExpls expls env' return (decls1 ++ d...
332
false
true
5
8
73
130
65
65
null
null
FranklinChen/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
irts_c FAny x = x
17
irts_c FAny x = x
17
irts_c FAny x = x
17
false
false
1
5
4
16
5
11
null
null
junjihashimoto/persistent
persistent/Database/Persist/Sql/Migration.hs
mit
executeMigrate :: MonadIO m => Bool -> Text -> ReaderT SqlBackend m Text executeMigrate silent s = do unless silent $ liftIO $ hPutStrLn stderr $ "Migrating: " ++ unpack s rawExecute s [] return s -- | Sort the alter DB statements so tables are created before constraints are -- added.
298
executeMigrate :: MonadIO m => Bool -> Text -> ReaderT SqlBackend m Text executeMigrate silent s = do unless silent $ liftIO $ hPutStrLn stderr $ "Migrating: " ++ unpack s rawExecute s [] return s -- | Sort the alter DB statements so tables are created before constraints are -- added.
298
executeMigrate silent s = do unless silent $ liftIO $ hPutStrLn stderr $ "Migrating: " ++ unpack s rawExecute s [] return s -- | Sort the alter DB statements so tables are created before constraints are -- added.
225
false
true
0
11
64
84
38
46
null
null
SamirTalwar/advent-of-code
2021/AOC_24_1.hs
mit
lookup (Num n) _ = n
20
lookup (Num n) _ = n
20
lookup (Num n) _ = n
20
false
false
0
6
5
19
8
11
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
4265 = 4264
11
4265 = 4264
11
4265 = 4264
11
false
false
1
5
2
10
3
7
null
null
atomb/dalvik
Dalvik/Parser.hs
bsd-3-clause
parseTypeList :: Get [TypeId] parseTypeList = do size <- getWord32le replicateM (fromIntegral size) getWord16le
115
parseTypeList :: Get [TypeId] parseTypeList = do size <- getWord32le replicateM (fromIntegral size) getWord16le
115
parseTypeList = do size <- getWord32le replicateM (fromIntegral size) getWord16le
85
false
true
0
9
17
38
18
20
null
null
xmonad/xmonad-contrib
XMonad/Layout/Decoration.hs
bsd-3-clause
-- | Given a 'Rectangle' and a list of 'Rectangle's is True if the -- 'Rectangle' is not completely contained by any 'Rectangle' of the -- list. isVisible :: Rectangle -> [Rectangle] -> Bool isVisible r = and . foldr f [] where f x xs = if r `isWithin` x then False : xs else True : xs -- | The contrary of 'isVisib...
324
isVisible :: Rectangle -> [Rectangle] -> Bool isVisible r = and . foldr f [] where f x xs = if r `isWithin` x then False : xs else True : xs -- | The contrary of 'isVisible'.
179
isVisible r = and . foldr f [] where f x xs = if r `isWithin` x then False : xs else True : xs -- | The contrary of 'isVisible'.
133
true
true
0
8
69
74
41
33
null
null
shimanekb/Learn_Haskell
ch2/fntype.hs
gpl-2.0
removeNonUppercase :: [Char] -> [Char] removeNonUppercase st = [c | c <- st, c `elem` ['A'..'Z']]
97
removeNonUppercase :: [Char] -> [Char] removeNonUppercase st = [c | c <- st, c `elem` ['A'..'Z']]
97
removeNonUppercase st = [c | c <- st, c `elem` ['A'..'Z']]
58
false
true
0
8
15
50
28
22
null
null
k0001/gtk2hs
tools/c2hs/base/state/CIO.hs
gpl-3.0
-- file handling -- ------------- openFileCIO :: FilePath -> IOMode -> PreCST e s Handle openFileCIO p m = liftIO $ do hnd <- openFile p m #if __GLASGOW_HASKELL__ >= 612 hSetEncoding hnd latin1 #endif return hnd
223
openFileCIO :: FilePath -> IOMode -> PreCST e s Handle openFileCIO p m = liftIO $ do hnd <- openFile p m #if __GLASGOW_HASKELL__ >= 612 hSetEncoding hnd latin1 #endif return hnd
188
openFileCIO p m = liftIO $ do hnd <- openFile p m #if __GLASGOW_HASKELL__ >= 612 hSetEncoding hnd latin1 #endif return hnd
129
true
true
0
9
48
65
31
34
null
null
Persi/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkSpacefulness11= verifyTree checkSpacefulness "rm ${10//foo/bar}"
74
prop_checkSpacefulness11= verifyTree checkSpacefulness "rm ${10//foo/bar}"
74
prop_checkSpacefulness11= verifyTree checkSpacefulness "rm ${10//foo/bar}"
74
false
false
0
5
4
11
5
6
null
null
AlexanderPankiv/ghc
compiler/basicTypes/Name.hs
bsd-3-clause
nameSortStableString :: NameSort -> String nameSortStableString System = "$_sys"
80
nameSortStableString :: NameSort -> String nameSortStableString System = "$_sys"
80
nameSortStableString System = "$_sys"
37
false
true
0
5
8
18
9
9
null
null
izgzhen/hadrian
src/Hadrian/Expression.hs
mit
input :: FilePattern -> Predicate c b input f = any (f ?==) <$> getInputs
73
input :: FilePattern -> Predicate c b input f = any (f ?==) <$> getInputs
73
input f = any (f ?==) <$> getInputs
35
false
true
0
7
14
34
17
17
null
null
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs
mpl-2.0
-- | The ID of the VPC endpoint. veVPCEndpointId :: Lens' VPCEndpoint (Maybe Text) veVPCEndpointId = lens _veVPCEndpointId (\ s a -> s{_veVPCEndpointId = a})
157
veVPCEndpointId :: Lens' VPCEndpoint (Maybe Text) veVPCEndpointId = lens _veVPCEndpointId (\ s a -> s{_veVPCEndpointId = a})
124
veVPCEndpointId = lens _veVPCEndpointId (\ s a -> s{_veVPCEndpointId = a})
74
true
true
0
9
24
46
25
21
null
null
energyflowanalysis/efa-2.1
src/EFA/Example/Topology/Tripod/State.hs
bsd-3-clause
state3 = identifyFlowState Tripod.topology [undirEdge node0 node2, dirEdge node2 node1]
96
state3 = identifyFlowState Tripod.topology [undirEdge node0 node2, dirEdge node2 node1]
96
state3 = identifyFlowState Tripod.topology [undirEdge node0 node2, dirEdge node2 node1]
96
false
false
0
7
18
29
14
15
null
null
codecurve/FieldML-Haskell-01
src/FieldML/Utility01.hs
bsd-2-clause
codomain (Sin _) = Reals
24
codomain (Sin _) = Reals
24
codomain (Sin _) = Reals
24
false
false
0
6
4
16
7
9
null
null
joncol/mal
haskell/step2/app/Main.hs
mpl-2.0
getClosingToken :: Set (ErrorItem Char) -> Maybe Char getClosingToken ts = listToMaybe $ foldr accum [] ")]" where makeTokens c = Tokens $ c :| [] accum c = bool id ((:) c) $ S.member (makeTokens c) ts
214
getClosingToken :: Set (ErrorItem Char) -> Maybe Char getClosingToken ts = listToMaybe $ foldr accum [] ")]" where makeTokens c = Tokens $ c :| [] accum c = bool id ((:) c) $ S.member (makeTokens c) ts
214
getClosingToken ts = listToMaybe $ foldr accum [] ")]" where makeTokens c = Tokens $ c :| [] accum c = bool id ((:) c) $ S.member (makeTokens c) ts
160
false
true
3
9
50
108
50
58
null
null
jship/metronome
local_deps/netwire/Control/Wire/Interval.hs
bsd-3-clause
-- | After the given time period. -- -- * Depends: now after the given time period. -- -- * Inhibits: for the given time period. after :: (HasTime t s, Monoid e) => t -> Wire s e m a a after t' = mkPure $ \ds x -> let t = t' - dtime ds in if t <= 0 then (Right x, mkId) else (Lef...
338
after :: (HasTime t s, Monoid e) => t -> Wire s e m a a after t' = mkPure $ \ds x -> let t = t' - dtime ds in if t <= 0 then (Right x, mkId) else (Left mempty, after t)
208
after t' = mkPure $ \ds x -> let t = t' - dtime ds in if t <= 0 then (Right x, mkId) else (Left mempty, after t)
152
true
true
0
12
111
113
60
53
null
null
tjakway/ghcjvm
compiler/basicTypes/Name.hs
bsd-3-clause
-- This is used for hsigs: we want to use the name of the originally exported -- entity, but edit the location to refer to the reexport site setNameLoc :: Name -> SrcSpan -> Name setNameLoc name loc = name {n_loc = loc}
219
setNameLoc :: Name -> SrcSpan -> Name setNameLoc name loc = name {n_loc = loc}
78
setNameLoc name loc = name {n_loc = loc}
40
true
true
0
7
42
39
20
19
null
null
literate-unitb/literate-unitb
src/Interactive/Pipeline.hs
mit
prover :: Shared -> IO (IO ()) prover (Shared { .. }) = do tok <- newEmptyMVar observe pr_obl tok -- req <- newEmptyMVar req <- newTBQueueIO 20 forM_ [1..40] $ \p -> forkOn p $ worker req return $ forever $ do takeMVar tok inc 1 po <- read_obs pr_obl forM_ (keys ...
1,248
prover :: Shared -> IO (IO ()) prover (Shared { .. }) = do tok <- newEmptyMVar observe pr_obl tok -- req <- newEmptyMVar req <- newTBQueueIO 20 forM_ [1..40] $ \p -> forkOn p $ worker req return $ forever $ do takeMVar tok inc 1 po <- read_obs pr_obl forM_ (keys ...
1,248
prover (Shared { .. }) = do tok <- newEmptyMVar observe pr_obl tok -- req <- newEmptyMVar req <- newTBQueueIO 20 forM_ [1..40] $ \p -> forkOn p $ worker req return $ forever $ do takeMVar tok inc 1 po <- read_obs pr_obl forM_ (keys po) $ \k -> do po <...
1,217
false
true
0
21
523
471
227
244
null
null
ezyang/ghc
libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
bsd-3-clause
promotedT :: Name -> TypeQ promotedT = return . PromotedT
57
promotedT :: Name -> TypeQ promotedT = return . PromotedT
57
promotedT = return . PromotedT
30
false
true
0
5
9
19
10
9
null
null
infotroph/pandoc
src/Text/Pandoc/Writers/DokuWiki.hs
gpl-2.0
inlineToDokuWiki opts (Quoted SingleQuote lst) = do contents <- inlineListToDokuWiki opts lst return $ "\8216" ++ contents ++ "\8217"
137
inlineToDokuWiki opts (Quoted SingleQuote lst) = do contents <- inlineListToDokuWiki opts lst return $ "\8216" ++ contents ++ "\8217"
137
inlineToDokuWiki opts (Quoted SingleQuote lst) = do contents <- inlineListToDokuWiki opts lst return $ "\8216" ++ contents ++ "\8217"
137
false
false
0
9
22
48
21
27
null
null
buetow/hsbot
HsBot/IRC.hs
bsd-3-clause
ircWrite :: Handle -> String -> String -> IO () ircWrite h s t = do printf "> %s %s\n" s t hPrintf h "%s %s\r\n" s t
125
ircWrite :: Handle -> String -> String -> IO () ircWrite h s t = do printf "> %s %s\n" s t hPrintf h "%s %s\r\n" s t
125
ircWrite h s t = do printf "> %s %s\n" s t hPrintf h "%s %s\r\n" s t
77
false
true
0
10
36
62
27
35
null
null
keithodulaigh/Hets
HasCASL/Builtin.hs
gpl-2.0
parseDAnno :: String -> Annotation parseDAnno str = case parse annotationL "" str of Left _ -> error "parseDAnno" Right a -> a
134
parseDAnno :: String -> Annotation parseDAnno str = case parse annotationL "" str of Left _ -> error "parseDAnno" Right a -> a
134
parseDAnno str = case parse annotationL "" str of Left _ -> error "parseDAnno" Right a -> a
99
false
true
3
6
30
48
23
25
null
null
michalkonecny/mixed-types-num
src/Numeric/MixedTypes/Elementary.hs
bsd-3-clause
{-| HSpec properties that each implementation of CanLog should satisfy. -} specCanLogReal :: _ => T t -> Spec specCanLogReal (T typeName :: T t) = describe (printf "CanLog %s" typeName) $ do it "log(1/x) == -(log x)" $ do property $ \ (x_ :: t) -> let x = enforceRange (Just 0, Nothing) x_ in ...
1,173
specCanLogReal :: _ => T t -> Spec specCanLogReal (T typeName :: T t) = describe (printf "CanLog %s" typeName) $ do it "log(1/x) == -(log x)" $ do property $ \ (x_ :: t) -> let x = enforceRange (Just 0, Nothing) x_ in x !>! 0 && (1/x) !>! 0 ==> log (1/x) ?==?$ -(log x) it "l...
1,095
specCanLogReal (T typeName :: T t) = describe (printf "CanLog %s" typeName) $ do it "log(1/x) == -(log x)" $ do property $ \ (x_ :: t) -> let x = enforceRange (Just 0, Nothing) x_ in x !>! 0 && (1/x) !>! 0 ==> log (1/x) ?==?$ -(log x) it "log(x*y) = log(x)+log(y)" $ do p...
1,058
true
true
0
25
364
456
228
228
null
null
tedkornish/stack
scripts/release/release.hs
bsd-3-clause
-- | Shake rules. rules :: Global -> [String] -> Rules () rules global@Global{..} args = do case args of [] -> error "No wanted target(s) specified." _ -> want args phony releasePhony $ do need [checkPhony] need [uploadPhony] phony cleanPhony $ removeFilesAfter rele...
12,854
rules :: Global -> [String] -> Rules () rules global@Global{..} args = do case args of [] -> error "No wanted target(s) specified." _ -> want args phony releasePhony $ do need [checkPhony] need [uploadPhony] phony cleanPhony $ removeFilesAfter releaseDir ["//*"] ...
12,836
rules global@Global{..} args = do case args of [] -> error "No wanted target(s) specified." _ -> want args phony releasePhony $ do need [checkPhony] need [uploadPhony] phony cleanPhony $ removeFilesAfter releaseDir ["//*"] phony checkPhony $ need [relea...
12,796
true
true
0
23
3,722
3,097
1,515
1,582
null
null
urbanslug/ghc
compiler/rename/RnBinds.hs
bsd-3-clause
-- {-# SPECIALISE #-} pragmas can refer to imported Ids -- so, in the top-level case (when mb_names is Nothing) -- we use lookupOccRn. If there's both an imported and a local 'f' -- then the SPECIALISE pragma is ambiguous, unlike all other signatures renameSig ctxt sig@(SpecSig v tys inl) = do { new_v <- case ctxt ...
770
renameSig ctxt sig@(SpecSig v tys inl) = do { new_v <- case ctxt of TopSigCtxt {} -> lookupLocatedOccRn v _ -> lookupSigOccRn ctxt sig v -- ; (new_ty, fvs) <- rnHsSigType (quotes (ppr v)) ty ; (new_ty, fvs) <- foldM do_one ([],emptyFVs) tys ...
518
renameSig ctxt sig@(SpecSig v tys inl) = do { new_v <- case ctxt of TopSigCtxt {} -> lookupLocatedOccRn v _ -> lookupSigOccRn ctxt sig v -- ; (new_ty, fvs) <- rnHsSigType (quotes (ppr v)) ty ; (new_ty, fvs) <- foldM do_one ([],emptyFVs) tys ...
518
true
false
0
12
222
190
102
88
null
null
rwtodd/small_programs
i_ching/haskell/iching.hs
gpl-2.0
disphex :: (Arr.Array Int [String]) -> Hexagram -> IO () disphex descs hex = do disp_lines hex disp_trigrams hex disp_desc $ descs Arr.! (hex_king_wen hex) -- control stuff
185
disphex :: (Arr.Array Int [String]) -> Hexagram -> IO () disphex descs hex = do disp_lines hex disp_trigrams hex disp_desc $ descs Arr.! (hex_king_wen hex) -- control stuff
185
disphex descs hex = do disp_lines hex disp_trigrams hex disp_desc $ descs Arr.! (hex_king_wen hex) -- control stuff
128
false
true
0
9
40
74
35
39
null
null
xkollar/handy-haskell
other/pt-2012-09/main.hs
gpl-3.0
ppList :: Show a => [a] -> IO () ppList = putStr . unlines . map show
69
ppList :: Show a => [a] -> IO () ppList = putStr . unlines . map show
69
ppList = putStr . unlines . map show
36
false
true
2
9
16
49
21
28
null
null
jystic/river
src/River/X64/Pretty.hs
bsd-3-clause
------------------------------------------------------------------------ displayProgram :: Decoration -> [Instruction] -> String displayProgram decoration instructions = let c0main = Label $ Name "__c0_main" doc = Pretty.renderPretty 0.8 80 $ vcat [ annotate AnnKeyword (text ".globl") <+...
1,046
displayProgram :: Decoration -> [Instruction] -> String displayProgram decoration instructions = let c0main = Label $ Name "__c0_main" doc = Pretty.renderPretty 0.8 80 $ vcat [ annotate AnnKeyword (text ".globl") <+> ppLabel c0main , empty , ppLabel c0main <> tex...
972
displayProgram decoration instructions = let c0main = Label $ Name "__c0_main" doc = Pretty.renderPretty 0.8 80 $ vcat [ annotate AnnKeyword (text ".globl") <+> ppLabel c0main , empty , ppLabel c0main <> text ":" , ppProgram instructions ] pu...
916
true
true
0
15
322
265
129
136
null
null
lenary/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
constDocs c@(AType (ATInt (ITFixed IT64))) = "Sixty-four bits (unsigned)"
73
constDocs c@(AType (ATInt (ITFixed IT64))) = "Sixty-four bits (unsigned)"
73
constDocs c@(AType (ATInt (ITFixed IT64))) = "Sixty-four bits (unsigned)"
73
false
false
0
12
8
30
15
15
null
null
evansb/jasper
src/Language/Java/Parser/Core.hs
mit
isLParen _ = False
18
isLParen _ = False
18
isLParen _ = False
18
false
false
0
4
3
10
4
6
null
null
alexander-at-github/eta
compiler/ETA/Main/HscMain.hs
bsd-3-clause
hscCheckSafe' :: DynFlags -> Module -> SrcSpan -> Hsc (Maybe PackageKey, [PackageKey]) hscCheckSafe' dflags m l = do (tw, pkgs) <- isModSafe m l case tw of False -> return (Nothing, pkgs) True | isHomePkg m -> return (Nothing, pkgs) | otherwise -> return (Just $ modul...
4,050
hscCheckSafe' :: DynFlags -> Module -> SrcSpan -> Hsc (Maybe PackageKey, [PackageKey]) hscCheckSafe' dflags m l = do (tw, pkgs) <- isModSafe m l case tw of False -> return (Nothing, pkgs) True | isHomePkg m -> return (Nothing, pkgs) | otherwise -> return (Just $ modul...
4,050
hscCheckSafe' dflags m l = do (tw, pkgs) <- isModSafe m l case tw of False -> return (Nothing, pkgs) True | isHomePkg m -> return (Nothing, pkgs) | otherwise -> return (Just $ modulePackageKey m, pkgs) where isModSafe :: Module -> SrcSpan -> Hsc (Bool, [PackageK...
3,963
false
true
3
19
1,592
868
422
446
null
null
rprospero/NeutronPipe
tests/Properties.hs
mit
mean :: [Double] -> Double mean xs = sum xs / (fromIntegral $ length xs)
72
mean :: [Double] -> Double mean xs = sum xs / (fromIntegral $ length xs)
72
mean xs = sum xs / (fromIntegral $ length xs)
45
false
true
0
8
14
38
19
19
null
null
brendanhay/gogol
gogol-serviceuser/gen/Network/Google/ServiceUser/Types/Product.hs
mpl-2.0
-- | Creates a value of 'EnumValue' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'evName' -- -- * 'evOptions' -- -- * 'evNumber' enumValue :: EnumValue enumValue = EnumValue' {_evName = Nothing, _evOptions = Nothing, _evNumber...
331
enumValue :: EnumValue enumValue = EnumValue' {_evName = Nothing, _evOptions = Nothing, _evNumber = Nothing}
114
enumValue = EnumValue' {_evName = Nothing, _evOptions = Nothing, _evNumber = Nothing}
87
true
true
0
6
62
40
28
12
null
null
ndmitchell/tagsoup
test/TagSoup/Generate/Type.hs
bsd-3-clause
fromRedex (RCase x xs) = eCase (EVar x) (map (second fromRedex) xs)
67
fromRedex (RCase x xs) = eCase (EVar x) (map (second fromRedex) xs)
67
fromRedex (RCase x xs) = eCase (EVar x) (map (second fromRedex) xs)
67
false
false
0
9
11
42
20
22
null
null
michaelt/streaming-bytestring
bench/benchbuilders.hs
bsd-3-clause
renderCellTB :: Cell -> TB.Builder renderCellTB (StringC cs) = renderStringTB cs
80
renderCellTB :: Cell -> TB.Builder renderCellTB (StringC cs) = renderStringTB cs
80
renderCellTB (StringC cs) = renderStringTB cs
45
false
true
0
7
10
29
14
15
null
null
mcmaniac/ghc
compiler/nativeGen/X86/Regs.hs
bsd-3-clause
globalRegMaybe Hp = Just (RealRegSingle REG_Hp)
69
globalRegMaybe Hp = Just (RealRegSingle REG_Hp)
69
globalRegMaybe Hp = Just (RealRegSingle REG_Hp)
69
false
false
0
7
27
19
8
11
null
null
anton-k/language-css
src/Language/Css/Build/Idents.hs
bsd-3-clause
-- | medium medium :: Idents a => a medium = ident "medium"
59
medium :: Idents a => a medium = ident "medium"
47
medium = ident "medium"
23
true
true
0
7
12
28
12
16
null
null
sgillespie/ghc
compiler/stgSyn/StgLint.hs
bsd-3-clause
checkFunApp :: Type -- The function type -> [Type] -- The arg type(s) -> MsgDoc -- Error message -> LintM (Maybe Type) -- Just ty => result type is accurate checkFunApp fun_ty arg_tys msg = do { case mb_msg of Just msg -> addE...
1,596
checkFunApp :: Type -- The function type -> [Type] -- The arg type(s) -> MsgDoc -- Error message -> LintM (Maybe Type) checkFunApp fun_ty arg_tys msg = do { case mb_msg of Just msg -> addErrL msg Nothing -> return () ...
1,555
checkFunApp fun_ty arg_tys msg = do { case mb_msg of Just msg -> addErrL msg Nothing -> return () ; return mb_ty } where (mb_ty, mb_msg) = cfa True fun_ty arg_tys cfa :: Bool -> Type -> [Type] -> (Maybe Type -- Accurate result? , Maybe MsgDoc...
1,356
true
true
0
11
543
463
232
231
null
null
vTurbine/ghc
compiler/specialise/Rules.hs
bsd-3-clause
match_ty :: RuleMatchEnv -> RuleSubst -> Type -- Template -> Type -- Target -> Maybe RuleSubst -- Matching Core types: use the matcher in TcType. -- Notice that we treat newtypes as opaque. For example, suppose -- we have a specialised version of a func...
6,871
match_ty :: RuleMatchEnv -> RuleSubst -> Type -- Template -> Type -- Target -> Maybe RuleSubst match_ty renv subst ty1 ty2 = do { tv_subst' <- Unify.ruleMatchTyX (rv_tmpls renv) (rv_lcl renv) tv_subst ty1 ty2 ; return (subst { rs_t...
6,605
match_ty renv subst ty1 ty2 = do { tv_subst' <- Unify.ruleMatchTyX (rv_tmpls renv) (rv_lcl renv) tv_subst ty1 ty2 ; return (subst { rs_tv_subst = tv_subst' }) } where tv_subst = rs_tv_subst subst {- Note [Expanding variables] ~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is another Very Important rule: ...
6,444
true
true
0
10
1,766
112
61
51
null
null
sdiehl/ghc
compiler/basicTypes/Literal.hs
bsd-3-clause
-- | A nonsense literal of type @forall (a :: 'TYPE' 'UnliftedRep'). a@. rubbishLit :: Literal rubbishLit = LitRubbish
118
rubbishLit :: Literal rubbishLit = LitRubbish
45
rubbishLit = LitRubbish
23
true
true
0
6
18
19
8
11
null
null
qpliu/esolang
flower/hs/Parse.hs
gpl-3.0
resolveSendAll :: Definition -> Either [ParseError] Definition resolveSendAll (Definition position name inputs outputs statements) = do (unsent,resolved) <- resolveSends inputs outputs statements [] if null unsent then return (Definition position name inputs outputs resolved) else Left [newError...
2,383
resolveSendAll :: Definition -> Either [ParseError] Definition resolveSendAll (Definition position name inputs outputs statements) = do (unsent,resolved) <- resolveSends inputs outputs statements [] if null unsent then return (Definition position name inputs outputs resolved) else Left [newError...
2,383
resolveSendAll (Definition position name inputs outputs statements) = do (unsent,resolved) <- resolveSends inputs outputs statements [] if null unsent then return (Definition position name inputs outputs resolved) else Left [newErrorMessage (Message ("Unused output(s):" ++ show (map symbolName u...
2,320
false
true
0
20
558
724
368
356
null
null
rodsol/atomspace
opencog/haskell/OpenCog/AtomSpace/Template.hs
agpl-3.0
removeComm [] = []
18
removeComm [] = []
18
removeComm [] = []
18
false
false
0
6
3
13
6
7
null
null
IreneKnapp/haskell-to-idris
Haskell/Main.hs
mit
main :: IO () main = do parameters <- IO.getArgs case parameters of [inputPath, outputPath] -> do convertFile inputPath outputPath _ -> do putStrLn $ "Usage: haskell-to-idris input.hs output.idr"
219
main :: IO () main = do parameters <- IO.getArgs case parameters of [inputPath, outputPath] -> do convertFile inputPath outputPath _ -> do putStrLn $ "Usage: haskell-to-idris input.hs output.idr"
219
main = do parameters <- IO.getArgs case parameters of [inputPath, outputPath] -> do convertFile inputPath outputPath _ -> do putStrLn $ "Usage: haskell-to-idris input.hs output.idr"
205
false
true
0
12
52
65
31
34
null
null
reouno/gradient-method
.stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/autogen/Paths_Gradient_Method.hs
bsd-3-clause
getLibexecDir = catchIO (getEnv "Gradient_Method_libexecdir") (\_ -> return libexecdir)
87
getLibexecDir = catchIO (getEnv "Gradient_Method_libexecdir") (\_ -> return libexecdir)
87
getLibexecDir = catchIO (getEnv "Gradient_Method_libexecdir") (\_ -> return libexecdir)
87
false
false
1
8
8
31
14
17
null
null
creichert/hsebaysdk
Web/Ebay.hs
bsd-3-clause
requestHeadersFromConfig :: FindVerb -> EbayConfig -> [HTTP.Header] requestHeadersFromConfig fb EbayConfig{..} = [ ("Content-Type", "application/json") , ("X-EBAY-SOA-SERVICE-NAME", utf8 ebService) , ("X-EBAY-SOA-SERVICE-VERSION", utf8 ebVersion) , ("X-EBAY-SOA-SECURITY-APPNAME", utf8 ebAppId) , ("X...
836
requestHeadersFromConfig :: FindVerb -> EbayConfig -> [HTTP.Header] requestHeadersFromConfig fb EbayConfig{..} = [ ("Content-Type", "application/json") , ("X-EBAY-SOA-SERVICE-NAME", utf8 ebService) , ("X-EBAY-SOA-SERVICE-VERSION", utf8 ebVersion) , ("X-EBAY-SOA-SECURITY-APPNAME", utf8 ebAppId) , ("X...
836
requestHeadersFromConfig fb EbayConfig{..} = [ ("Content-Type", "application/json") , ("X-EBAY-SOA-SERVICE-NAME", utf8 ebService) , ("X-EBAY-SOA-SERVICE-VERSION", utf8 ebVersion) , ("X-EBAY-SOA-SECURITY-APPNAME", utf8 ebAppId) , ("X-EBAY-SOA-GLOBAL-ID", utf8 ebSiteId) , ("X-EBAY-SOA-OPERATION-NA...
768
false
true
3
8
132
174
96
78
null
null
gorkinovich/Haskell
Problems/Problem0019.hs
mit
intToDate :: Integer -> Date intToDate n = (y, m, d) where y = getYearFromInt n md = fromIntegral $ remYearFromInt' n y dbm = getDaysByMonth y gdm md' m' | md' > d' = gdm (md' - d') (m' + 1) | otherwise = (m', md') where d' = dbm !! (m' - 1) ...
441
intToDate :: Integer -> Date intToDate n = (y, m, d) where y = getYearFromInt n md = fromIntegral $ remYearFromInt' n y dbm = getDaysByMonth y gdm md' m' | md' > d' = gdm (md' - d') (m' + 1) | otherwise = (m', md') where d' = dbm !! (m' - 1) ...
441
intToDate n = (y, m, d) where y = getYearFromInt n md = fromIntegral $ remYearFromInt' n y dbm = getDaysByMonth y gdm md' m' | md' > d' = gdm (md' - d') (m' + 1) | otherwise = (m', md') where d' = dbm !! (m' - 1) (m, d) = gdm md 1 -...
412
false
true
6
10
157
154
79
75
null
null
thoughtpolice/infinity
Setup.hs
bsd-3-clause
copyInfinity _ _ _ _ = do copyFile (joinPath ["dist","build","infinity",inf]) inf ignore (createDirectory "Log" >> createDirectory "State")
143
copyInfinity _ _ _ _ = do copyFile (joinPath ["dist","build","infinity",inf]) inf ignore (createDirectory "Log" >> createDirectory "State")
143
copyInfinity _ _ _ _ = do copyFile (joinPath ["dist","build","infinity",inf]) inf ignore (createDirectory "Log" >> createDirectory "State")
143
false
false
0
10
20
60
29
31
null
null
exitmouse/proper
glfw-demo/src/Main.hs
gpl-3.0
windowIconifyCallback tc win ia = atomically $ writeTQueue tc $ EventWindowIconify win ia
101
windowIconifyCallback tc win ia = atomically $ writeTQueue tc $ EventWindowIconify win ia
101
windowIconifyCallback tc win ia = atomically $ writeTQueue tc $ EventWindowIconify win ia
101
false
false
0
7
24
29
13
16
null
null
andersjel/hlit
hlit-types/src/Text/Lit/RenderFloat.hs
gpl-3.0
-- The exponent -- | A thin wrapper around Numeric.floatToDigits toFloatD :: RealFloat a => a -> FloatD toFloatD x = FloatD (x < 0) ds ex where (ds, ex) = Numeric.floatToDigits 10 (abs x) -- | Round off to /sig/ digits. Includes trailing zeros.
250
toFloatD :: RealFloat a => a -> FloatD toFloatD x = FloatD (x < 0) ds ex where (ds, ex) = Numeric.floatToDigits 10 (abs x) -- | Round off to /sig/ digits. Includes trailing zeros.
184
toFloatD x = FloatD (x < 0) ds ex where (ds, ex) = Numeric.floatToDigits 10 (abs x) -- | Round off to /sig/ digits. Includes trailing zeros.
145
true
true
0
8
50
77
37
40
null
null
jecisc/TP_PF_L3
PF-TP3/src/TP3_PF_FERLICOT/Main.hs
mit
ilbert :: LSysteme hilbert = lsysteme "X" regles where regles 'X' = "+YF-XFX-FY+" regles 'Y' = "-XF+YFY+FX-" regles s = [s]
150
hilbert :: LSysteme hilbert = lsysteme "X" regles where regles 'X' = "+YF-XFX-FY+" regles 'Y' = "-XF+YFY+FX-" regles s = [s]
150
hilbert = lsysteme "X" regles where regles 'X' = "+YF-XFX-FY+" regles 'Y' = "-XF+YFY+FX-" regles s = [s]
130
false
true
0
6
47
52
24
28
null
null
tjakway/ghcjvm
compiler/utils/Util.hs
bsd-3-clause
-- | @spanEnd p l == reverse (span p (reverse l))@. The first list -- returns actually comes after the second list (when you look at the -- input list). spanEnd :: (a -> Bool) -> [a] -> ([a], [a]) spanEnd p l = go l [] [] l where go yes _rev_yes rev_no [] = (yes, reverse rev_no) go yes rev_yes rev_no (x:xs) ...
463
spanEnd :: (a -> Bool) -> [a] -> ([a], [a]) spanEnd p l = go l [] [] l where go yes _rev_yes rev_no [] = (yes, reverse rev_no) go yes rev_yes rev_no (x:xs) | p x = go yes (x : rev_yes) rev_no xs | otherwise = go xs [] (x : rev_yes ++ rev_no) xs
310
spanEnd p l = go l [] [] l where go yes _rev_yes rev_no [] = (yes, reverse rev_no) go yes rev_yes rev_no (x:xs) | p x = go yes (x : rev_yes) rev_no xs | otherwise = go xs [] (x : rev_yes ++ rev_no) xs
266
true
true
1
10
152
191
88
103
null
null
lywaterman/parconc-examples
server.hs
bsd-3-clause
port :: Int port = 44444
24
port :: Int port = 44444
24
port = 44444
12
false
true
0
6
5
18
7
11
null
null
ProLambda/Times
Utilities/Chat/Server.hs
gpl-3.0
talk :: WS.Connection -> MVar MsgCache -> MVar ServerState -> Client -> IO () talk conn mcache' state (user, _) = forever $ do msg <- WS.receiveData conn ctime <- liftIO $ getCurrentTime let time = T.pack $ drop 11 $ take 16 $ show ctime msg' = user `mappend` "@" `mappend` time `mappend`...
428
talk :: WS.Connection -> MVar MsgCache -> MVar ServerState -> Client -> IO () talk conn mcache' state (user, _) = forever $ do msg <- WS.receiveData conn ctime <- liftIO $ getCurrentTime let time = T.pack $ drop 11 $ take 16 $ show ctime msg' = user `mappend` "@" `mappend` time `mappend`...
428
talk conn mcache' state (user, _) = forever $ do msg <- WS.receiveData conn ctime <- liftIO $ getCurrentTime let time = T.pack $ drop 11 $ take 16 $ show ctime msg' = user `mappend` "@" `mappend` time `mappend` ": " `mappend` msg modifyMVar_ mcache' $ \x -> return $ addMsg msg' x readMVar state >>= broa...
330
false
true
0
15
108
185
89
96
null
null
ekmett/wxHaskell
wxdirect/src/CompileClasses.hs
lgpl-2.1
haskellToCArgIO :: String -> Bool -> Arg -> String haskellToCArgIO methodName' isSelf arg = case argType arg of String _ -> "withCWString " ++ haskellName (argName arg) ++ " $ \\" ++ haskellCStringName (argName arg) ++ " -> " ++ nl ByteString Lazy -> "withArray (LB.unpack " ++ has...
1,962
haskellToCArgIO :: String -> Bool -> Arg -> String haskellToCArgIO methodName' isSelf arg = case argType arg of String _ -> "withCWString " ++ haskellName (argName arg) ++ " $ \\" ++ haskellCStringName (argName arg) ++ " -> " ++ nl ByteString Lazy -> "withArray (LB.unpack " ++ has...
1,962
haskellToCArgIO methodName' isSelf arg = case argType arg of String _ -> "withCWString " ++ haskellName (argName arg) ++ " $ \\" ++ haskellCStringName (argName arg) ++ " -> " ++ nl ByteString Lazy -> "withArray (LB.unpack " ++ haskellName (argName arg) ++ ") $ \\" ...
1,911
false
true
0
19
751
565
267
298
null
null
ddssff/pandoc
src/Text/Pandoc/Parsing.hs
gpl-2.0
-- | Parse a string with a given parser and state readWith :: Parser [Char] st a -> st -> String -> Either PandocError a readWith p t inp = runIdentity $ readWithM p t inp
198
readWith :: Parser [Char] st a -> st -> String -> Either PandocError a readWith p t inp = runIdentity $ readWithM p t inp
148
readWith p t inp = runIdentity $ readWithM p t inp
50
true
true
2
9
62
65
29
36
null
null
pubnub/haskell
src/Network/Pubnub.hs
mit
userIdOptions :: PN -> [(B.ByteString, B.ByteString)] userIdOptions pn = maybe [] (\u -> [("uuid", encodeUtf8 u)]) (uuid_key pn) ++ maybe [] (\a -> [("auth", encodeUtf8 a)]) (auth_key pn)
191
userIdOptions :: PN -> [(B.ByteString, B.ByteString)] userIdOptions pn = maybe [] (\u -> [("uuid", encodeUtf8 u)]) (uuid_key pn) ++ maybe [] (\a -> [("auth", encodeUtf8 a)]) (auth_key pn)
191
userIdOptions pn = maybe [] (\u -> [("uuid", encodeUtf8 u)]) (uuid_key pn) ++ maybe [] (\a -> [("auth", encodeUtf8 a)]) (auth_key pn)
137
false
true
0
11
31
105
57
48
null
null
kelnage/tamarin-prover
src/Web/Types.hs
gpl-3.0
-- | We use the ordering in order to display loaded theories to the user. -- We first compare by name, then by time loaded, and then by source: Theories -- that were loaded from the command-line are displayed earlier then -- interactively loaded ones. compareTI :: TheoryInfo -> TheoryInfo -> Ordering compareTI (TheoryI...
526
compareTI :: TheoryInfo -> TheoryInfo -> Ordering compareTI (TheoryInfo _ i1 t1 p1 a1 o1 _) (TheoryInfo _ i2 t2 p2 a2 o2 _) = mconcat [ comparing (get thyName) i1 i2 , comparing zonedTimeToUTC t1 t2 , compare a1 a2 , compare p1 p2 , compare o1 o2 ]
274
compareTI (TheoryInfo _ i1 t1 p1 a1 o1 _) (TheoryInfo _ i2 t2 p2 a2 o2 _) = mconcat [ comparing (get thyName) i1 i2 , comparing zonedTimeToUTC t1 t2 , compare a1 a2 , compare p1 p2 , compare o1 o2 ]
224
true
true
0
9
120
117
60
57
null
null
glutamate/probably-base
Math/Probably/NelderMead.hs
bsd-3-clause
secondLast (x:y:[]) = x
23
secondLast (x:y:[]) = x
23
secondLast (x:y:[]) = x
23
false
false
0
8
3
23
11
12
null
null
urbanslug/ghc
compiler/coreSyn/CoreSyn.hs
bsd-3-clause
isTyCoArg _ = False
31
isTyCoArg _ = False
31
isTyCoArg _ = False
31
false
false
0
4
15
10
4
6
null
null
ice1000/OI-codes
codewars/authoring/haskell/TypeTranspiler.hs
agpl-3.0
stringP (c : cs) = do charP c stringP cs return $ c : cs --
65
stringP (c : cs) = do charP c stringP cs return $ c : cs --
65
stringP (c : cs) = do charP c stringP cs return $ c : cs --
65
false
false
0
8
21
41
18
23
null
null
arne-schroppe/dash
src/Language/Dash/Normalization/Recursion.hs
mit
pullUpUnresolvedFreeVars :: String -> [String] -> [String] -> [String] pullUpUnresolvedFreeVars name currentEfv nextEfv = -- pull up all new free vars that are not resolved by this context let cleanedEfv = delete name currentEfv in let nextContextAllEfv = union cleanedEfv nextEfv in nextContextAllEfv
309
pullUpUnresolvedFreeVars :: String -> [String] -> [String] -> [String] pullUpUnresolvedFreeVars name currentEfv nextEfv = -- pull up all new free vars that are not resolved by this context let cleanedEfv = delete name currentEfv in let nextContextAllEfv = union cleanedEfv nextEfv in nextContextAllEfv
309
pullUpUnresolvedFreeVars name currentEfv nextEfv = -- pull up all new free vars that are not resolved by this context let cleanedEfv = delete name currentEfv in let nextContextAllEfv = union cleanedEfv nextEfv in nextContextAllEfv
238
false
true
0
11
50
72
36
36
null
null
NCrashed/PowerCom
src/powercom/Channel/Processing.hs
gpl-3.0
receiveFrameHandler :: ProcessId -> ProcessId -> MessageBuffer -> Connection -> InnerChannelOptions -> (ProcessId, String, BS.ByteString) -> Process Bool receiveFrameHandler physLayerId transitId messageBuffer conn optionsRef (_, com, byteFrame) = do options <- getOptions optionsRef case decodeFrame byte...
3,297
receiveFrameHandler :: ProcessId -> ProcessId -> MessageBuffer -> Connection -> InnerChannelOptions -> (ProcessId, String, BS.ByteString) -> Process Bool receiveFrameHandler physLayerId transitId messageBuffer conn optionsRef (_, com, byteFrame) = do options <- getOptions optionsRef case decodeFrame byteF...
3,296
receiveFrameHandler physLayerId transitId messageBuffer conn optionsRef (_, com, byteFrame) = do options <- getOptions optionsRef case decodeFrame byteFrame of Just frame -> case frame of AckFrame -> return () RetFrame -> return () _ -> do ...
3,137
false
true
46
18
1,064
706
362
344
null
null
tel/hs-nanomsg
src/Network/Nanomsg/C.hs
apache-2.0
prio5 = Priority 5
24
prio5 = Priority 5
24
prio5 = Priority 5
24
false
false
1
5
9
12
4
8
null
null
abhean/phffp-examples
src/Lib.hs
bsd-3-clause
myWords s = firstWord : myWords rest where firstWord = takeWhile (/= ' ') s rest = dropWhile (== ' ') . dropWhile (/= ' ') $ s
136
myWords s = firstWord : myWords rest where firstWord = takeWhile (/= ' ') s rest = dropWhile (== ' ') . dropWhile (/= ' ') $ s
136
myWords s = firstWord : myWords rest where firstWord = takeWhile (/= ' ') s rest = dropWhile (== ' ') . dropWhile (/= ' ') $ s
136
false
false
1
8
37
61
31
30
null
null
nomeata/ghc
compiler/nativeGen/RegAlloc/Graph/Spill.hs
bsd-3-clause
akeSpillStats :: SpillS -> SpillStats makeSpillStats s = SpillStats { spillStoreLoad = stateSpillSL s }
127
makeSpillStats :: SpillS -> SpillStats makeSpillStats s = SpillStats { spillStoreLoad = stateSpillSL s }
127
makeSpillStats s = SpillStats { spillStoreLoad = stateSpillSL s }
88
false
true
0
7
38
37
17
20
null
null
spinningfire/aikatsu
test/Spec.hs
bsd-3-clause
photoMaria = Photo "Himesato Maria" Maria 60 1400 "Cute Flash" 7800 R Cute 54 (AppealUp 15) AuroraFantasy
105
photoMaria = Photo "Himesato Maria" Maria 60 1400 "Cute Flash" 7800 R Cute 54 (AppealUp 15) AuroraFantasy
105
photoMaria = Photo "Himesato Maria" Maria 60 1400 "Cute Flash" 7800 R Cute 54 (AppealUp 15) AuroraFantasy
105
false
false
1
7
16
39
17
22
null
null
jarmond/locomotive-haskell
src/Loco/Eval.hs
gpl-3.0
-- |Execute a command. command :: String -> [LocoValue] -> IOLocoEval Jump command name args = maybe (throwError $ UnknownCommand name) ($ args) (lookupCmd name)
213
command :: String -> [LocoValue] -> IOLocoEval Jump command name args = maybe (throwError $ UnknownCommand name) ($ args) (lookupCmd name)
190
command name args = maybe (throwError $ UnknownCommand name) ($ args) (lookupCmd name)
138
true
true
0
8
76
58
30
28
null
null
vTurbine/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
-- The type ('PtrRepLifted) ptrRepLiftedTy :: Type ptrRepLiftedTy = mkTyConTy $ promoteDataCon ptrRepLiftedDataCon
114
ptrRepLiftedTy :: Type ptrRepLiftedTy = mkTyConTy $ promoteDataCon ptrRepLiftedDataCon
86
ptrRepLiftedTy = mkTyConTy $ promoteDataCon ptrRepLiftedDataCon
63
true
true
2
6
12
27
11
16
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/ECSTaskDefinitionTmpfs.hs
mit
ecsTaskDefinitionTmpfs :: ECSTaskDefinitionTmpfs ecsTaskDefinitionTmpfs = ECSTaskDefinitionTmpfs { _eCSTaskDefinitionTmpfsContainerPath = Nothing , _eCSTaskDefinitionTmpfsMountOptions = Nothing , _eCSTaskDefinitionTmpfsSize = Nothing }
248
ecsTaskDefinitionTmpfs :: ECSTaskDefinitionTmpfs ecsTaskDefinitionTmpfs = ECSTaskDefinitionTmpfs { _eCSTaskDefinitionTmpfsContainerPath = Nothing , _eCSTaskDefinitionTmpfsMountOptions = Nothing , _eCSTaskDefinitionTmpfsSize = Nothing }
248
ecsTaskDefinitionTmpfs = ECSTaskDefinitionTmpfs { _eCSTaskDefinitionTmpfsContainerPath = Nothing , _eCSTaskDefinitionTmpfsMountOptions = Nothing , _eCSTaskDefinitionTmpfsSize = Nothing }
197
false
true
1
7
31
38
20
18
null
null
rgaiacs/pandoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
metaKey :: OrgParser String metaKey = map toLower <$> many1 (noneOf ": \n\r") <* char ':' <* skipSpaces
149
metaKey :: OrgParser String metaKey = map toLower <$> many1 (noneOf ": \n\r") <* char ':' <* skipSpaces
149
metaKey = map toLower <$> many1 (noneOf ": \n\r") <* char ':' <* skipSpaces
121
false
true
0
10
63
41
19
22
null
null
duplode/stack
src/main/Main.hs
bsd-3-clause
pathCmd :: [Text] -> GlobalOpts -> IO () pathCmd keys go = withBuildConfigAndLock go (\_ -> do env <- ask let cfg = envConfig env bc = envConfigBuildConfig cfg menv <- getMinimalEnvOverride snap <- packageDatabaseDeps local <- ...
1,222
pathCmd :: [Text] -> GlobalOpts -> IO () pathCmd keys go = withBuildConfigAndLock go (\_ -> do env <- ask let cfg = envConfig env bc = envConfigBuildConfig cfg menv <- getMinimalEnvOverride snap <- packageDatabaseDeps local <- ...
1,222
pathCmd keys go = withBuildConfigAndLock go (\_ -> do env <- ask let cfg = envConfig env bc = envConfigBuildConfig cfg menv <- getMinimalEnvOverride snap <- packageDatabaseDeps local <- packageDatabaseLocal snaproot...
1,181
false
true
0
20
746
235
117
118
null
null
cgmckeever/contests
2011-mebipenny/contest/hexcode/hexcode.hs
mit
main = do line <- getLine handleInput line
50
main = do line <- getLine handleInput line
50
main = do line <- getLine handleInput line
50
false
false
0
7
15
19
8
11
null
null
angerman/data-bitcode-edsl
src/EDSL/Monad/Types.hs
bsd-3-clause
i8 = i 8
8
i8 = i 8
8
i8 = i 8
8
false
false
1
5
3
13
4
9
null
null
CRogers/stack
src/Stack/Upload.hs
bsd-3-clause
-- | Upload a single tarball with the given @Uploader@. -- -- Since 0.1.0.0 upload :: Uploader -> FilePath -> IO () upload = upload_
132
upload :: Uploader -> FilePath -> IO () upload = upload_
56
upload = upload_
16
true
true
0
9
24
33
16
17
null
null
romanb/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/CreateConfigurationTemplate.hs
mpl-2.0
-- | The name of the solution stack this configuration set uses. cctrSolutionStackName :: Lens' CreateConfigurationTemplateResponse (Maybe Text) cctrSolutionStackName = lens _cctrSolutionStackName (\s a -> s { _cctrSolutionStackName = a })
243
cctrSolutionStackName :: Lens' CreateConfigurationTemplateResponse (Maybe Text) cctrSolutionStackName = lens _cctrSolutionStackName (\s a -> s { _cctrSolutionStackName = a })
178
cctrSolutionStackName = lens _cctrSolutionStackName (\s a -> s { _cctrSolutionStackName = a })
98
true
true
1
9
34
52
25
27
null
null
robbinch/tinc
src/Run.hs
mit
callExec :: Facts -> String -> [String] -> IO () callExec Facts{..} name args = do pid <- if factsUseNix then uncurry spawnProcess $ nixShell name args else spawnProcess "cabal" ("exec" : "--" : name : args) waitForProcess pid >>= throwIO
250
callExec :: Facts -> String -> [String] -> IO () callExec Facts{..} name args = do pid <- if factsUseNix then uncurry spawnProcess $ nixShell name args else spawnProcess "cabal" ("exec" : "--" : name : args) waitForProcess pid >>= throwIO
250
callExec Facts{..} name args = do pid <- if factsUseNix then uncurry spawnProcess $ nixShell name args else spawnProcess "cabal" ("exec" : "--" : name : args) waitForProcess pid >>= throwIO
201
false
true
1
14
52
111
51
60
null
null