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
guoy34/ampersand
src/Database/Design/Ampersand/FSpec/ToFSpec/Calc.hs
gpl-3.0
--where e'= if null prf then "" else let (expr,_,_):_ = prf in showHS options "" expr showProof _ [] = fromList []
133
showProof _ [] = fromList []
47
showProof _ [] = fromList []
47
true
false
0
6
41
19
9
10
null
null
uduki/hsQt
Qtc/Gui/QTextCursor.hs
bsd-2-clause
setBlockCharFormat :: QTextCursor a -> ((QTextCharFormat t1)) -> IO () setBlockCharFormat x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QTextCursor_setBlockCharFormat cobj_x0 cobj_x1
222
setBlockCharFormat :: QTextCursor a -> ((QTextCharFormat t1)) -> IO () setBlockCharFormat x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QTextCursor_setBlockCharFormat cobj_x0 cobj_x1
222
setBlockCharFormat x0 (x1) = withObjectPtr x0 $ \cobj_x0 -> withObjectPtr x1 $ \cobj_x1 -> qtc_QTextCursor_setBlockCharFormat cobj_x0 cobj_x1
151
false
true
4
10
36
80
37
43
null
null
haskell-distributed/distributed-process-client-server
tests/TestPrioritisedProcess.hs
bsd-3-clause
testOverflowHandling :: TestResult Bool -> Process () testOverflowHandling result = do pid <- mkOverflowHandlingServer (\s -> s { recvTimeout = RecvMaxBacklog 100 }) wrk <- spawnLocal $ mapM_ (cast pid . show) ([1..50000] :: [Int]) sleep $ seconds 1 cast pid "abc" -- just getting in line here... st <- call ...
484
testOverflowHandling :: TestResult Bool -> Process () testOverflowHandling result = do pid <- mkOverflowHandlingServer (\s -> s { recvTimeout = RecvMaxBacklog 100 }) wrk <- spawnLocal $ mapM_ (cast pid . show) ([1..50000] :: [Int]) sleep $ seconds 1 cast pid "abc" -- just getting in line here... st <- call ...
484
testOverflowHandling result = do pid <- mkOverflowHandlingServer (\s -> s { recvTimeout = RecvMaxBacklog 100 }) wrk <- spawnLocal $ mapM_ (cast pid . show) ([1..50000] :: [Int]) sleep $ seconds 1 cast pid "abc" -- just getting in line here... st <- call pid GetState :: Process Int -- the result of GetStat...
430
false
true
0
13
101
163
77
86
null
null
alexander-at-github/eta
compiler/ETA/TypeCheck/TcGenGenerics.hs
bsd-3-clause
mkProd_E :: GenericKind_DC -- Generic or Generic1? -> US -- Base for unique names -> [(RdrName, Type)] -- List of variables matched on the lhs and their types -> LHsExpr RdrName -- Resulting product expression mkProd_E _ _ [] = mkM1_E (nlHsVar u1DataCon_RDR)
309
mkProd_E :: GenericKind_DC -- Generic or Generic1? -> US -- Base for unique names -> [(RdrName, Type)] -- List of variables matched on the lhs and their types -> LHsExpr RdrName mkProd_E _ _ [] = mkM1_E (nlHsVar u1DataCon_RDR)
277
mkProd_E _ _ [] = mkM1_E (nlHsVar u1DataCon_RDR)
54
true
true
0
9
93
57
31
26
null
null
bertdouglas/euler-haskell
001-050/14a.hs
mit
answer = solve limit 0 0
24
answer = solve limit 0 0
24
answer = solve limit 0 0
24
false
false
1
5
5
19
6
13
null
null
asakamirai/kazura-queue
test/WVarConcurrentSpec.hs
bsd-3-clause
tryTakeWCachedSeqSpec :: HS.Spec tryTakeWCachedSeqSpec = HS.describe "tryTakeWCached" $ do T.whenWVarIsFresh . T.withLatestCache $ \ prepare -> do T.ioprop "takes the value before(failure)/after(success) putWCached" $ do (_, val1 :: Int, _, wc) <- prepare [val2] <- T.genSatisfy 1 (/=...
4,052
tryTakeWCachedSeqSpec :: HS.Spec tryTakeWCachedSeqSpec = HS.describe "tryTakeWCached" $ do T.whenWVarIsFresh . T.withLatestCache $ \ prepare -> do T.ioprop "takes the value before(failure)/after(success) putWCached" $ do (_, val1 :: Int, _, wc) <- prepare [val2] <- T.genSatisfy 1 (/=...
4,052
tryTakeWCachedSeqSpec = HS.describe "tryTakeWCached" $ do T.whenWVarIsFresh . T.withLatestCache $ \ prepare -> do T.ioprop "takes the value before(failure)/after(success) putWCached" $ do (_, val1 :: Int, _, wc) <- prepare [val2] <- T.genSatisfy 1 (/= val1) M.void $ WV.pu...
4,019
false
true
0
23
1,473
1,350
731
619
null
null
ezyang/ghc
compiler/llvmGen/Llvm/PpLlvm.hs
bsd-3-clause
-- | Print out a list of LLVM blocks. ppLlvmBlocks :: LlvmBlocks -> SDoc ppLlvmBlocks blocks = vcat $ map ppLlvmBlock blocks
124
ppLlvmBlocks :: LlvmBlocks -> SDoc ppLlvmBlocks blocks = vcat $ map ppLlvmBlock blocks
86
ppLlvmBlocks blocks = vcat $ map ppLlvmBlock blocks
51
true
true
0
6
21
28
14
14
null
null
omefire/lens
src/Control/Exception/Lens.hs
bsd-3-clause
_Denormal :: AsArithException t => Prism' t () _Denormal = _ArithException . dimap seta (either id id) . right' . rmap (Denormal <$) where seta Denormal = Right () seta t = Left (pure t)
199
_Denormal :: AsArithException t => Prism' t () _Denormal = _ArithException . dimap seta (either id id) . right' . rmap (Denormal <$) where seta Denormal = Right () seta t = Left (pure t)
199
_Denormal = _ArithException . dimap seta (either id id) . right' . rmap (Denormal <$) where seta Denormal = Right () seta t = Left (pure t)
152
false
true
0
10
47
88
43
45
null
null
brendanhay/gogol
gogol-sheets/gen/Network/Google/Sheets/Types/Product.hs
mpl-2.0
-- | The BigQuery table id. bqtsTableId :: Lens' BigQueryTableSpec (Maybe Text) bqtsTableId = lens _bqtsTableId (\ s a -> s{_bqtsTableId = a})
144
bqtsTableId :: Lens' BigQueryTableSpec (Maybe Text) bqtsTableId = lens _bqtsTableId (\ s a -> s{_bqtsTableId = a})
116
bqtsTableId = lens _bqtsTableId (\ s a -> s{_bqtsTableId = a})
64
true
true
1
9
24
52
25
27
null
null
dmbarbour/awelon
hsrc_util/ABCGraph.hs
bsd-3-clause
opAff be = asProd be >>= \ (b,e) -> asCode b >>= \ cb -> newBoolConst True >>= \ aff -> let cb' = cb { cb_aff = aff } in return (Prod (Block cb') e)
169
opAff be = asProd be >>= \ (b,e) -> asCode b >>= \ cb -> newBoolConst True >>= \ aff -> let cb' = cb { cb_aff = aff } in return (Prod (Block cb') e)
169
opAff be = asProd be >>= \ (b,e) -> asCode b >>= \ cb -> newBoolConst True >>= \ aff -> let cb' = cb { cb_aff = aff } in return (Prod (Block cb') e)
169
false
false
7
11
56
96
47
49
null
null
sthiele/hasple
ASP.hs
gpl-3.0
--mkAddition (Negation a) b = (mkNegation (mkSubtraction a b)) mkAddition a b = Addition a b
92
mkAddition a b = Addition a b
29
mkAddition a b = Addition a b
29
true
false
0
5
15
17
8
9
null
null
brendanhay/gogol
gogol-spanner/gen/Network/Google/Resource/Spanner/Projects/Instances/Databases/Sessions/Rollback.hs
mpl-2.0
-- | Creates a value of 'ProjectsInstancesDatabasesSessionsRollback' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'pidsriXgafv' -- -- * 'pidsriUploadProtocol' -- -- * 'pidsriAccessToken' -- -- * 'pidsriUploadType' -- -- * 'pidsriPay...
919
projectsInstancesDatabasesSessionsRollback :: RollbackRequest -- ^ 'pidsriPayload' -> Text -- ^ 'pidsriSession' -> ProjectsInstancesDatabasesSessionsRollback projectsInstancesDatabasesSessionsRollback pPidsriPayload_ pPidsriSession_ = ProjectsInstancesDatabasesSessionsRollback' { _pidsriXgafv = Nothin...
544
projectsInstancesDatabasesSessionsRollback pPidsriPayload_ pPidsriSession_ = ProjectsInstancesDatabasesSessionsRollback' { _pidsriXgafv = Nothing , _pidsriUploadProtocol = Nothing , _pidsriAccessToken = Nothing , _pidsriUploadType = Nothing , _pidsriPayload = pPidsriPayload_ , _pidsriSession =...
374
true
true
0
8
150
96
62
34
null
null
limaner2002/EPC-tools
USACScripts/src/Scripts/Random.hs
bsd-3-clause
arbitraryInput (Button btn) = pure $ Right $ Button btn
55
arbitraryInput (Button btn) = pure $ Right $ Button btn
55
arbitraryInput (Button btn) = pure $ Right $ Button btn
55
false
false
0
6
9
27
12
15
null
null
TomMD/ghc
compiler/nativeGen/NCGMonad.hs
bsd-3-clause
unNat :: NatM a -> NatM_State -> (a, NatM_State) unNat (NatM a) = a
67
unNat :: NatM a -> NatM_State -> (a, NatM_State) unNat (NatM a) = a
67
unNat (NatM a) = a
18
false
true
0
7
13
37
19
18
null
null
gs-akhan/haskel-experiments
currying.hs
mit
addThree = ( +3 )
17
addThree = ( +3 )
17
addThree = ( +3 )
17
false
false
1
6
4
14
6
8
null
null
bixuanzju/fcore
lib/archive/ClosureFNew.hs
bsd-2-clause
-- TODO: better choice getArity _ = 0
37
getArity _ = 0
14
getArity _ = 0
14
true
false
0
5
7
10
5
5
null
null
randen/cabal
cabal-install/Main.hs
bsd-3-clause
wrapperCmd :: Monoid flags => CommandUI flags -> (flags -> Flag Verbosity) -> (flags -> Flag String) -> CommandSpec Action wrapperCmd ui verbosity distPref = CommandSpec ui (\ui' -> wrapperAction ui' verbosity distPref) NormalCommand
233
wrapperCmd :: Monoid flags => CommandUI flags -> (flags -> Flag Verbosity) -> (flags -> Flag String) -> CommandSpec Action wrapperCmd ui verbosity distPref = CommandSpec ui (\ui' -> wrapperAction ui' verbosity distPref) NormalCommand
233
wrapperCmd ui verbosity distPref = CommandSpec ui (\ui' -> wrapperAction ui' verbosity distPref) NormalCommand
110
false
true
0
12
33
89
42
47
null
null
olsner/ghc
compiler/stgSyn/CoreToStg.hs
bsd-3-clause
mkStgRhs :: FreeVarsInfo -> Id -> StgBinderInfo -> StgExpr -> StgRhs mkStgRhs = mkStgRhs' con_updateable where con_updateable _ _ = False
139
mkStgRhs :: FreeVarsInfo -> Id -> StgBinderInfo -> StgExpr -> StgRhs mkStgRhs = mkStgRhs' con_updateable where con_updateable _ _ = False
139
mkStgRhs = mkStgRhs' con_updateable where con_updateable _ _ = False
70
false
true
1
10
22
50
22
28
null
null
Lykos/Sara
tests/Sara/TestUtils/RegressionTestUtils.hs
gpl-3.0
unknownVariable :: Parser E.UnknownElement unknownVariable = do reservedToken "UnknownVariable" name <- L.identifierToken return $ E.UnknownVariable name
159
unknownVariable :: Parser E.UnknownElement unknownVariable = do reservedToken "UnknownVariable" name <- L.identifierToken return $ E.UnknownVariable name
159
unknownVariable = do reservedToken "UnknownVariable" name <- L.identifierToken return $ E.UnknownVariable name
116
false
true
0
9
21
43
19
24
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x2F95F' = "\x7AEE"
34
decomposeChar '\x2F95F' = "\x7AEE"
34
decomposeChar '\x2F95F' = "\x7AEE"
34
false
false
0
4
3
10
4
6
null
null
byteally/webapi
webapi-openapi/src/WebApi/OpenAPI.hs
bsd-3-clause
createApiErr compSchemas hMap (Just x) [] = createApiErr compSchemas hMap Nothing [(0,x)]
89
createApiErr compSchemas hMap (Just x) [] = createApiErr compSchemas hMap Nothing [(0,x)]
89
createApiErr compSchemas hMap (Just x) [] = createApiErr compSchemas hMap Nothing [(0,x)]
89
false
false
0
7
11
41
21
20
null
null
mainland/dph
dph-lifted-copy/Data/Array/Parallel/Lifted/TH/Repr.hs
bsd-3-clause
inlineD :: Name -> DecQ inlineD name = pragInlD name Inline FunLike AllPhases
77
inlineD :: Name -> DecQ inlineD name = pragInlD name Inline FunLike AllPhases
77
inlineD name = pragInlD name Inline FunLike AllPhases
53
false
true
0
5
12
27
13
14
null
null
rblaze/haskell-dbus
tests/DBusTests/Transport.hs
apache-2.0
test_ListenTcp_IPv4 :: TestTree test_ListenTcp_IPv4 = testCase "ipv4" $ runResourceT $ do let Just addr = address "tcp" (Map.fromList [ ("family", "ipv4") ]) (_, l) <- allocate (transportListen socketTransportOptions addr) transportListenerClose let params = addressP...
480
test_ListenTcp_IPv4 :: TestTree test_ListenTcp_IPv4 = testCase "ipv4" $ runResourceT $ do let Just addr = address "tcp" (Map.fromList [ ("family", "ipv4") ]) (_, l) <- allocate (transportListen socketTransportOptions addr) transportListenerClose let params = addressP...
480
test_ListenTcp_IPv4 = testCase "ipv4" $ runResourceT $ do let Just addr = address "tcp" (Map.fromList [ ("family", "ipv4") ]) (_, l) <- allocate (transportListen socketTransportOptions addr) transportListenerClose let params = addressParameters (transportListenerAddr...
448
false
true
0
15
112
150
72
78
null
null
Gabriel439/succinct
src/Succinct/Internal/Level.hs
bsd-2-clause
stride (L64 s _ _ _) = s
24
stride (L64 s _ _ _) = s
24
stride (L64 s _ _ _) = s
24
false
false
0
6
7
22
10
12
null
null
rdnetto/powerline-hs
src/Format.hs
apache-2.0
convAlign (FillAlign ' ' RightAlign) = ""
41
convAlign (FillAlign ' ' RightAlign) = ""
41
convAlign (FillAlign ' ' RightAlign) = ""
41
false
false
0
7
6
17
8
9
null
null
diogob/spyglass
src/Pasta.hs
bsd-3-clause
-- | Builds a greater than or equal comparison out of two expressions gte :: (IsExpression lexp, IsExpression rexp) => lexp -> rexp -> BooleanExpression gte = cmp ">="
167
gte :: (IsExpression lexp, IsExpression rexp) => lexp -> rexp -> BooleanExpression gte = cmp ">="
97
gte = cmp ">="
14
true
true
0
9
28
45
21
24
null
null
damianfral/clay
src/Clay/Render.hs
bsd-3-clause
frame :: Config -> (Double, [Rule]) -> Builder frame cfg (p, rs) = mconcat [ fromText (pack (show p)) , "% " , rules cfg [] rs ]
146
frame :: Config -> (Double, [Rule]) -> Builder frame cfg (p, rs) = mconcat [ fromText (pack (show p)) , "% " , rules cfg [] rs ]
146
frame cfg (p, rs) = mconcat [ fromText (pack (show p)) , "% " , rules cfg [] rs ]
99
false
true
0
11
45
81
41
40
null
null
jtdubs/Light
src/Light/Geometry/Quaternion.hs
mit
identityQuaternion :: Quaternion identityQuaternion = quaternion 0 0 0 1
72
identityQuaternion :: Quaternion identityQuaternion = quaternion 0 0 0 1
72
identityQuaternion = quaternion 0 0 0 1
39
false
true
0
6
9
30
11
19
null
null
ibabushkin/morgue
app/Dump.hs
bsd-3-clause
-- | strip the trailing newline from a `Text`, if there is any stripNewline :: Text -> Text stripNewline = fromMaybe <$> id <*> stripSuffix "\n"
144
stripNewline :: Text -> Text stripNewline = fromMaybe <$> id <*> stripSuffix "\n"
81
stripNewline = fromMaybe <$> id <*> stripSuffix "\n"
52
true
true
0
6
25
27
14
13
null
null
brendanhay/gogol
gogol-bigtableadmin/gen/Network/Google/Resource/BigtableAdmin/Operations/Get.hs
mpl-2.0
-- | OAuth access token. ogAccessToken :: Lens' OperationsGet (Maybe Text) ogAccessToken = lens _ogAccessToken (\ s a -> s{_ogAccessToken = a})
151
ogAccessToken :: Lens' OperationsGet (Maybe Text) ogAccessToken = lens _ogAccessToken (\ s a -> s{_ogAccessToken = a})
126
ogAccessToken = lens _ogAccessToken (\ s a -> s{_ogAccessToken = a})
76
true
true
0
9
29
48
25
23
null
null
awgn/cgrep
src/Config.hs
gpl-2.0
mkConfig :: YamlConfig -> Config mkConfig YamlConfig{..} = let configLanguages = mapMaybe readMaybe yamlLanguages configPruneDirs = yamlPruneDirs configColors = yamlColors configColorFile = fromMaybe [] (yamlColorFileName >>= readColor) configColorMatch = fromMaybe [] (yamlColorMat...
395
mkConfig :: YamlConfig -> Config mkConfig YamlConfig{..} = let configLanguages = mapMaybe readMaybe yamlLanguages configPruneDirs = yamlPruneDirs configColors = yamlColors configColorFile = fromMaybe [] (yamlColorFileName >>= readColor) configColorMatch = fromMaybe [] (yamlColorMat...
395
mkConfig YamlConfig{..} = let configLanguages = mapMaybe readMaybe yamlLanguages configPruneDirs = yamlPruneDirs configColors = yamlColors configColorFile = fromMaybe [] (yamlColorFileName >>= readColor) configColorMatch = fromMaybe [] (yamlColorMatch >>= readColor) configFi...
362
false
true
8
6
90
95
52
43
null
null
rickardlindberg/codemonitor
src/GUI/Renderer.hs
bsd-3-clause
failureColor = (255/255, 173/255, 173/255, 1)
45
failureColor = (255/255, 173/255, 173/255, 1)
45
failureColor = (255/255, 173/255, 173/255, 1)
45
false
false
1
7
5
34
17
17
null
null
raichoo/Idris-dev
src/Idris/Core/CaseTree.hs
bsd-3-clause
substSC n repl ImpossibleCase = ImpossibleCase
47
substSC n repl ImpossibleCase = ImpossibleCase
47
substSC n repl ImpossibleCase = ImpossibleCase
47
false
false
0
4
6
16
6
10
null
null
kazu-yamamoto/c10k
Network/C10kServer.hs
bsd-3-clause
runC10kServer' :: (Socket -> Dispatch) -> C10kConfig -> IO () runC10kServer' sDispatch cnf = do initHook cnf `catch` ignore if onlyOne then stay sDispatch cnf else prefork sDispatch cnf where onlyOne = preforkProcessNumber cnf == 1 -----------------------------------------------------------...
325
runC10kServer' :: (Socket -> Dispatch) -> C10kConfig -> IO () runC10kServer' sDispatch cnf = do initHook cnf `catch` ignore if onlyOne then stay sDispatch cnf else prefork sDispatch cnf where onlyOne = preforkProcessNumber cnf == 1 -----------------------------------------------------------...
325
runC10kServer' sDispatch cnf = do initHook cnf `catch` ignore if onlyOne then stay sDispatch cnf else prefork sDispatch cnf where onlyOne = preforkProcessNumber cnf == 1 ----------------------------------------------------------------
263
false
true
0
8
65
85
42
43
null
null
FPtje/GLuaFixer
src/GLua/Parser.hs
lgpl-2.1
lvl2 = [(And, AAnd), (CAnd, AAnd)]
34
lvl2 = [(And, AAnd), (CAnd, AAnd)]
34
lvl2 = [(And, AAnd), (CAnd, AAnd)]
34
false
false
0
6
5
24
15
9
null
null
audreyt/findbin
src/System/Environment/FindBin.hs
mit
-- | Get the full directory to the running program. getProgPath :: IO String getProgPath = alloca $ \p_argc -> alloca $ \p_argv -> do getProgArgv p_argc p_argv argv <- peek p_argv arg0 <- peekCString =<< peekElemOff argv 0 case arg0 of "<interactive>" -> alloca $ \p_argc' -> alloca $ \p_argv' ->...
1,933
getProgPath :: IO String getProgPath = alloca $ \p_argc -> alloca $ \p_argv -> do getProgArgv p_argc p_argv argv <- peek p_argv arg0 <- peekCString =<< peekElemOff argv 0 case arg0 of "<interactive>" -> alloca $ \p_argc' -> alloca $ \p_argv' -> do getFullProgArgv p_argc' p_argv' ...
1,881
getProgPath = alloca $ \p_argc -> alloca $ \p_argv -> do getProgArgv p_argc p_argv argv <- peek p_argv arg0 <- peekCString =<< peekElemOff argv 0 case arg0 of "<interactive>" -> alloca $ \p_argc' -> alloca $ \p_argv' -> do getFullProgArgv p_argc' p_argv' argc' <- peek p_a...
1,856
true
true
4
27
791
480
217
263
null
null
codingSteve/fp101x
20151026/lambdas.hs
cc0-1.0
l = [1,2,4,5,6,7]
17
l = [1,2,4,5,6,7]
17
l = [1,2,4,5,6,7]
17
false
false
1
5
2
27
15
12
null
null
green-haskell/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
orphNamesOfThings :: (a -> NameSet) -> [a] -> NameSet orphNamesOfThings f = foldr (unionNameSet . f) emptyNameSet
113
orphNamesOfThings :: (a -> NameSet) -> [a] -> NameSet orphNamesOfThings f = foldr (unionNameSet . f) emptyNameSet
113
orphNamesOfThings f = foldr (unionNameSet . f) emptyNameSet
59
false
true
0
8
16
49
24
25
null
null
minib00m/jpp
src/Evaluator.hs
mit
boolFromMem x = error $ "Develop error in boolFromMem " ++ show x
65
boolFromMem x = error $ "Develop error in boolFromMem " ++ show x
65
boolFromMem x = error $ "Develop error in boolFromMem " ++ show x
65
false
false
3
6
12
24
9
15
null
null
trbauer/hrun
HRun.hs
mit
t4 = runWithArgs ["-s","ls *"]
30
t4 = runWithArgs ["-s","ls *"]
30
t4 = runWithArgs ["-s","ls *"]
30
false
false
1
5
4
18
8
10
null
null
sjpet/quark
src/Quark/IOHelpers.hs
mit
autoComplete :: Int -> FilePath -> IO FilePath autoComplete k path = do c <- (filter $ startsWith partialName) <$> (listDirectory directory) let s0 = if length c == 0 then "" else head (drop (rem k $ length c) c) sIsDir <- doesDirectoryExist $ joinPath [directory, s0] ...
647
autoComplete :: Int -> FilePath -> IO FilePath autoComplete k path = do c <- (filter $ startsWith partialName) <$> (listDirectory directory) let s0 = if length c == 0 then "" else head (drop (rem k $ length c) c) sIsDir <- doesDirectoryExist $ joinPath [directory, s0] ...
647
autoComplete k path = do c <- (filter $ startsWith partialName) <$> (listDirectory directory) let s0 = if length c == 0 then "" else head (drop (rem k $ length c) c) sIsDir <- doesDirectoryExist $ joinPath [directory, s0] let s = if s0 /= "" && sIsDir ...
600
false
true
1
16
216
258
125
133
null
null
sgillis/bristle
src/Text/Bristle.hs
gpl-2.0
parseMustache :: Parser Mustache parseMustache = manyTill parseMustacheNode eof
79
parseMustache :: Parser Mustache parseMustache = manyTill parseMustacheNode eof
79
parseMustache = manyTill parseMustacheNode eof
46
false
true
0
5
8
19
9
10
null
null
shlevy/ghc
compiler/llvmGen/LlvmCodeGen/Base.hs
bsd-3-clause
strDisplayName_llvm :: CLabel -> LlvmM LMString strDisplayName_llvm lbl = do platform <- getLlvmPlatform dflags <- getDynFlags let sdoc = pprCLabel platform lbl depth = Outp.PartWay 1 style = Outp.mkUserStyle dflags Outp.reallyAlwaysQualify depth str = Outp.renderWithStyle dflags sdo...
367
strDisplayName_llvm :: CLabel -> LlvmM LMString strDisplayName_llvm lbl = do platform <- getLlvmPlatform dflags <- getDynFlags let sdoc = pprCLabel platform lbl depth = Outp.PartWay 1 style = Outp.mkUserStyle dflags Outp.reallyAlwaysQualify depth str = Outp.renderWithStyle dflags sdo...
367
strDisplayName_llvm lbl = do platform <- getLlvmPlatform dflags <- getDynFlags let sdoc = pprCLabel platform lbl depth = Outp.PartWay 1 style = Outp.mkUserStyle dflags Outp.reallyAlwaysQualify depth str = Outp.renderWithStyle dflags sdoc style return (fsLit (dropInfoSuffix str))
319
false
true
0
11
81
107
50
57
null
null
ian-ross/cabal
cabal-install/Distribution/Client/Install.hs
bsd-3-clause
theSpecifiedPackage :: Package pkg => PackageSpecifier pkg -> Maybe PackageId theSpecifiedPackage pkgSpec = case pkgSpec of NamedPackage name [PackageConstraintVersion name' version] | name == name' -> PackageIdentifier name <$> trivialRange version NamedPackage _ _ -> Nothing SpecificSourcePackage ...
916
theSpecifiedPackage :: Package pkg => PackageSpecifier pkg -> Maybe PackageId theSpecifiedPackage pkgSpec = case pkgSpec of NamedPackage name [PackageConstraintVersion name' version] | name == name' -> PackageIdentifier name <$> trivialRange version NamedPackage _ _ -> Nothing SpecificSourcePackage ...
916
theSpecifiedPackage pkgSpec = case pkgSpec of NamedPackage name [PackageConstraintVersion name' version] | name == name' -> PackageIdentifier name <$> trivialRange version NamedPackage _ _ -> Nothing SpecificSourcePackage pkg -> Just $ packageId pkg where -- | If a range includes only a single...
838
false
true
0
11
221
186
94
92
null
null
rwtodd/small_programs
i_ching/haskell/iching.hs
gpl-2.0
-- ------------------------------------------------------------ -- main loop and user input -- ------------------------------------------------------------ char_prompt words = do at 1 23 clear_line putStr words IO.hFlush IO.stdout c <- IO.getChar IO.getLine -- FIXME windows workaround return c
308
char_prompt words = do at 1 23 clear_line putStr words IO.hFlush IO.stdout c <- IO.getChar IO.getLine -- FIXME windows workaround return c
152
char_prompt words = do at 1 23 clear_line putStr words IO.hFlush IO.stdout c <- IO.getChar IO.getLine -- FIXME windows workaround return c
152
true
false
0
8
45
60
26
34
null
null
wjzz/GoStat
src/Transformations.hs
bsd-3-clause
findTriangles :: Move -> [Triangle] findTriangles m = filter (isInside m) triangles
83
findTriangles :: Move -> [Triangle] findTriangles m = filter (isInside m) triangles
83
findTriangles m = filter (isInside m) triangles
47
false
true
0
7
11
32
16
16
null
null
tjhunter/karps
haskell/src/Spark/Core/Internal/OpStructures.hs
apache-2.0
_aggStructFromProto :: PST.AggregationStructure -> Try AggOp _aggStructFromProto (PST.AggregationStructure l) = AggStruct . V.fromList <$> v where f (Just fn, x) = AggField <$> pure fn <*> x f x = tryError $ sformat ("_aggStructFromProto: deserialization failed on "%sh) x v = sequence (f . _aggOpFromProto <...
325
_aggStructFromProto :: PST.AggregationStructure -> Try AggOp _aggStructFromProto (PST.AggregationStructure l) = AggStruct . V.fromList <$> v where f (Just fn, x) = AggField <$> pure fn <*> x f x = tryError $ sformat ("_aggStructFromProto: deserialization failed on "%sh) x v = sequence (f . _aggOpFromProto <...
325
_aggStructFromProto (PST.AggregationStructure l) = AggStruct . V.fromList <$> v where f (Just fn, x) = AggField <$> pure fn <*> x f x = tryError $ sformat ("_aggStructFromProto: deserialization failed on "%sh) x v = sequence (f . _aggOpFromProto <$> l)
264
false
true
0
10
58
114
57
57
null
null
keera-studios/hsQt
Qtc/Enums/Core/QDataStream.hs
bsd-2-clause
ieQDataStreamVersion :: Int -> QDataStreamVersion ieQDataStreamVersion x = QEnum (CQDataStreamVersion x)
104
ieQDataStreamVersion :: Int -> QDataStreamVersion ieQDataStreamVersion x = QEnum (CQDataStreamVersion x)
104
ieQDataStreamVersion x = QEnum (CQDataStreamVersion x)
54
false
true
0
7
10
27
13
14
null
null
mydaum/cabal
Cabal/Distribution/ParseUtils.hs
bsd-3-clause
utf8Warnings :: LineNo -> String -> String -> [PWarning] utf8Warnings line fieldname s = take 1 [ UTFWarning n fieldname | (n,l) <- zip [line..] (lines s) , '\xfffd' `elem` l ]
196
utf8Warnings :: LineNo -> String -> String -> [PWarning] utf8Warnings line fieldname s = take 1 [ UTFWarning n fieldname | (n,l) <- zip [line..] (lines s) , '\xfffd' `elem` l ]
196
utf8Warnings line fieldname s = take 1 [ UTFWarning n fieldname | (n,l) <- zip [line..] (lines s) , '\xfffd' `elem` l ]
139
false
true
0
11
51
84
44
40
null
null
delta4d/codewars
kata/befunge-interpreter/Befunge93.hs
mit
o_i (Inter g dir pos code (a:st) o) = Inter g dir pos code st o' where o' = (reverse $ show a) ++ o
102
o_i (Inter g dir pos code (a:st) o) = Inter g dir pos code st o' where o' = (reverse $ show a) ++ o
102
o_i (Inter g dir pos code (a:st) o) = Inter g dir pos code st o' where o' = (reverse $ show a) ++ o
102
false
false
1
8
27
72
33
39
null
null
ozgurakgun/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
idemodeProcess fn (CaseSplitAt False pos str) = process fn (CaseSplitAt False pos str)
86
idemodeProcess fn (CaseSplitAt False pos str) = process fn (CaseSplitAt False pos str)
86
idemodeProcess fn (CaseSplitAt False pos str) = process fn (CaseSplitAt False pos str)
86
false
false
0
7
12
36
17
19
null
null
dysinger/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/UpdateInstance.hs
mpl-2.0
-- | For load-based or time-based instances, the type. uiAutoScalingType :: Lens' UpdateInstance (Maybe AutoScalingType) uiAutoScalingType = lens _uiAutoScalingType (\s a -> s { _uiAutoScalingType = a })
207
uiAutoScalingType :: Lens' UpdateInstance (Maybe AutoScalingType) uiAutoScalingType = lens _uiAutoScalingType (\s a -> s { _uiAutoScalingType = a })
152
uiAutoScalingType = lens _uiAutoScalingType (\s a -> s { _uiAutoScalingType = a })
86
true
true
0
9
31
46
25
21
null
null
hirokai/PaperServer
Parser/Publisher/ACS.hs
bsd-2-clause
mapAttr tags func n@(NodeElement (Element name attr cs)) = NodeElement (Element name (if name `elem` tags then func attr else attr) (map (mapAttr tags func) cs))
164
mapAttr tags func n@(NodeElement (Element name attr cs)) = NodeElement (Element name (if name `elem` tags then func attr else attr) (map (mapAttr tags func) cs))
164
mapAttr tags func n@(NodeElement (Element name attr cs)) = NodeElement (Element name (if name `elem` tags then func attr else attr) (map (mapAttr tags func) cs))
164
false
false
0
11
28
81
42
39
null
null
evolutics/haskell-formatter
testsuite/src/Language/Haskell/Formatter/Toolkit/TestTool.hs
gpl-3.0
codeHintAssertion :: FilePath -> HUnit.Assertion codeHintAssertion file = do errors <- HLint.hlint arguments HUnit.assertBool (showLines errors) $ null errors where arguments = [suppressFeedback, file] suppressFeedback = "--quiet" showLines = unlines . fmap show
289
codeHintAssertion :: FilePath -> HUnit.Assertion codeHintAssertion file = do errors <- HLint.hlint arguments HUnit.assertBool (showLines errors) $ null errors where arguments = [suppressFeedback, file] suppressFeedback = "--quiet" showLines = unlines . fmap show
289
codeHintAssertion file = do errors <- HLint.hlint arguments HUnit.assertBool (showLines errors) $ null errors where arguments = [suppressFeedback, file] suppressFeedback = "--quiet" showLines = unlines . fmap show
240
false
true
4
10
59
99
42
57
null
null
thomaseding/radix
src/Radix.hs
bsd-3-clause
allBases :: [Base] allBases = [2 .. 36]
40
allBases :: [Base] allBases = [2 .. 36]
39
allBases = [2 .. 36]
20
false
true
0
5
8
20
12
8
null
null
cpettitt/haskell-ptree
Data/PTree.hs
mit
insertWithKey' f k v n@(Node nk nv nc) | k == nk = case nv of Nothing -> Node nk (Just v) nc Just x -> let x' = f k v x in x' `seq` Node nk (Just x') nc | nk `S.isPrefixOf` k = updateChild (insertWithKey' f k v) n k | otherwise = join (node k (Just v)) n
303
insertWithKey' f k v n@(Node nk nv nc) | k == nk = case nv of Nothing -> Node nk (Just v) nc Just x -> let x' = f k v x in x' `seq` Node nk (Just x') nc | nk `S.isPrefixOf` k = updateChild (insertWithKey' f k v) n k | otherwise = join (node k (Just v)) n
303
insertWithKey' f k v n@(Node nk nv nc) | k == nk = case nv of Nothing -> Node nk (Just v) nc Just x -> let x' = f k v x in x' `seq` Node nk (Just x') nc | nk `S.isPrefixOf` k = updateChild (insertWithKey' f k v) n k | otherwise = join (node k (Just v)) n
303
false
false
0
14
110
177
83
94
null
null
Happy0/snowdrift
Import.hs
agpl-3.0
{- The following footnote and toc functions were used our pre-wiki about page At the time of this comment, they are no longer used anywhere live. -} footnote :: Integer -> Widget footnote note = [whamlet|$newline never <sup> <a name="fn_use#{show note}" href="#fn#{show note}"> #{show note} |]
318
footnote :: Integer -> Widget footnote note = [whamlet|$newline never <sup> <a name="fn_use#{show note}" href="#fn#{show note}"> #{show note} |]
168
footnote note = [whamlet|$newline never <sup> <a name="fn_use#{show note}" href="#fn#{show note}"> #{show note} |]
138
true
true
0
5
70
23
14
9
null
null
gergoerdi/metafun
src/Metafun/Compiler.hs
gpl-3.0
toMetaTy _ = MPL.MetaClass []
46
toMetaTy _ = MPL.MetaClass []
46
toMetaTy _ = MPL.MetaClass []
46
false
false
0
6
21
16
7
9
null
null
jgm/texmath
src/Text/TeXMath/Readers/TeX.hs
gpl-2.0
oneOfStrings :: [Text] -> TP Text oneOfStrings strs = oneOfStrings' (==) strs' <??> (intercalate ", " $ map show strs) where strs' = map (\x -> (T.unpack x, x)) strs -- | Like '(<?>)', but moves position back to the beginning of the parse -- before reporting the error.
276
oneOfStrings :: [Text] -> TP Text oneOfStrings strs = oneOfStrings' (==) strs' <??> (intercalate ", " $ map show strs) where strs' = map (\x -> (T.unpack x, x)) strs -- | Like '(<?>)', but moves position back to the beginning of the parse -- before reporting the error.
276
oneOfStrings strs = oneOfStrings' (==) strs' <??> (intercalate ", " $ map show strs) where strs' = map (\x -> (T.unpack x, x)) strs -- | Like '(<?>)', but moves position back to the beginning of the parse -- before reporting the error.
242
false
true
0
10
55
84
44
40
null
null
NorfairKing/project-euler
022/haskell/solution.hs
gpl-2.0
alphabet :: [Char] alphabet = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ"
59
alphabet :: [Char] alphabet = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ"
59
alphabet = "#ABCDEFGHIJKLMNOPQRSTUVWXYZ"
40
false
true
0
5
5
14
8
6
null
null
chetant/LibClang
src/Clang.hs
bsd-3-clause
-- | Parses a source file using libclang and allows you to analyze the -- resulting AST using a callback. -- -- More flexible alternatives to 'parseSourceFile' are available in -- "Clang.Index" and "Clang.TranslationUnit". parseSourceFile :: ClangBase m => FilePath -- ^ Source filename ...
616
parseSourceFile :: ClangBase m => FilePath -- ^ Source filename -> [String] -- ^ Clang-compatible compilation arguments -> (forall s. FFI.TranslationUnit s -> ClangT s m a) -- ^ Callback -> m (Maybe a) parseSourceFile path args f = Index.withNew False...
393
parseSourceFile path args f = Index.withNew False False $ \index -> TU.withParsed index (Just path) args DV.empty [] f
124
true
true
2
14
159
132
65
67
null
null
holzensp/ghc
compiler/cmm/PprC.hs
bsd-3-clause
commafy :: [SDoc] -> SDoc commafy xs = hsep $ punctuate comma xs
64
commafy :: [SDoc] -> SDoc commafy xs = hsep $ punctuate comma xs
64
commafy xs = hsep $ punctuate comma xs
38
false
true
0
6
12
30
15
15
null
null
alanz/annotations-play
src/ch6.hs
unlicense
tPlus :: Parser ExprToken tPlus = do { char '+'; return TPlus }
63
tPlus :: Parser ExprToken tPlus = do { char '+'; return TPlus }
63
tPlus = do { char '+'; return TPlus }
37
false
true
0
7
12
29
14
15
null
null
DaMSL/K3
src/Language/K3/Parser/SQL.hs
apache-2.0
outputScope :: ScopeId -> Identifier -> Maybe TableAlias -> SQLParseM ScopeId outputScope sid pfx alOpt = do t <- scopeType sid typedOutputScope t pfx alOpt
164
outputScope :: ScopeId -> Identifier -> Maybe TableAlias -> SQLParseM ScopeId outputScope sid pfx alOpt = do t <- scopeType sid typedOutputScope t pfx alOpt
164
outputScope sid pfx alOpt = do t <- scopeType sid typedOutputScope t pfx alOpt
86
false
true
0
8
32
56
25
31
null
null
sdiehl/ghc
libraries/base/GHC/IO/Handle/Internals.hs
bsd-3-clause
dEFAULT_CHAR_BUFFER_SIZE :: Int dEFAULT_CHAR_BUFFER_SIZE = 2048
63
dEFAULT_CHAR_BUFFER_SIZE :: Int dEFAULT_CHAR_BUFFER_SIZE = 2048
63
dEFAULT_CHAR_BUFFER_SIZE = 2048
31
false
true
0
4
5
11
6
5
null
null
facebookincubator/duckling
Duckling/Rules/CA.hs
bsd-3-clause
langRules (Seal Url) = []
25
langRules (Seal Url) = []
25
langRules (Seal Url) = []
25
false
false
0
6
4
18
8
10
null
null
rodrigo-machado/verigraph
src/CLI/ApplySndOrderRules.hs
gpl-3.0
typeGraph :: Grammar (TypedGraphMorphism a b) -> Graph (Maybe a) (Maybe b) typeGraph = codomain . start
103
typeGraph :: Grammar (TypedGraphMorphism a b) -> Graph (Maybe a) (Maybe b) typeGraph = codomain . start
103
typeGraph = codomain . start
28
false
true
0
8
16
47
23
24
null
null
hspec/hspec
hspec-core/vendor/Control/Concurrent/Async.hs
mit
-- | Like 'withAsync' but uses 'forkIOWithUnmask' internally. The -- child thread is passed a function that can be used to unmask -- asynchronous exceptions. withAsyncWithUnmask :: ((forall c. IO c -> IO c) -> IO a) -> (Async a -> IO b) -> IO b withAsyncWithUnmask actionWith = withAsyncUsing rawForkIO (actionWith ...
333
withAsyncWithUnmask :: ((forall c. IO c -> IO c) -> IO a) -> (Async a -> IO b) -> IO b withAsyncWithUnmask actionWith = withAsyncUsing rawForkIO (actionWith unsafeUnmask)
174
withAsyncWithUnmask actionWith = withAsyncUsing rawForkIO (actionWith unsafeUnmask)
85
true
true
0
11
57
83
41
42
null
null
glutamate/tnutils
StripCode.hs
bsd-3-clause
onHead :: (a-> a) -> [a] -> [a] onHead f [] =[]
47
onHead :: (a-> a) -> [a] -> [a] onHead f [] =[]
47
onHead f [] =[]
15
false
true
0
7
11
41
22
19
null
null
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Layout/Groups/Wmii.hs
bsd-2-clause
-- | Switch the focused group to the \"maximized\" layout. groupToFullLayout :: X () groupToFullLayout = sendMessage $ escape $ JumpToLayout "Full"
147
groupToFullLayout :: X () groupToFullLayout = sendMessage $ escape $ JumpToLayout "Full"
88
groupToFullLayout = sendMessage $ escape $ JumpToLayout "Full"
62
true
true
0
6
21
28
14
14
null
null
sapek/pandoc
src/Text/Pandoc/Readers/MediaWiki.hs
gpl-2.0
inlinesInTags :: String -> MWParser Inlines inlinesInTags tag = try $ do (_,raw) <- htmlTag (~== TagOpen tag []) if '/' `elem` raw -- self-closing tag then return mempty else trimInlines . mconcat <$> manyTill inline (htmlTag (~== TagClose tag))
273
inlinesInTags :: String -> MWParser Inlines inlinesInTags tag = try $ do (_,raw) <- htmlTag (~== TagOpen tag []) if '/' `elem` raw -- self-closing tag then return mempty else trimInlines . mconcat <$> manyTill inline (htmlTag (~== TagClose tag))
273
inlinesInTags tag = try $ do (_,raw) <- htmlTag (~== TagOpen tag []) if '/' `elem` raw -- self-closing tag then return mempty else trimInlines . mconcat <$> manyTill inline (htmlTag (~== TagClose tag))
229
false
true
0
15
67
104
52
52
null
null
ricardomiranda/haskellGeneticTSP
Init.hs
mit
newMap :: Int -> IO Cities -- number of cities newMap 0 = return []
67
newMap :: Int -> IO Cities newMap 0 = return []
47
newMap 0 = return []
20
true
true
0
7
14
32
14
18
null
null
spechub/Hets
Common/Lib/Rel.hs
gpl-2.0
-- | insert an ordered pair insertPair :: Ord a => a -> a -> Rel a -> Rel a insertPair a b = Rel . MapSet.setInsert a b . toMap
127
insertPair :: Ord a => a -> a -> Rel a -> Rel a insertPair a b = Rel . MapSet.setInsert a b . toMap
99
insertPair a b = Rel . MapSet.setInsert a b . toMap
51
true
true
0
9
30
57
27
30
null
null
ktvoelker/cookie-jar
test/Util.hs
gpl-3.0
time :: Int -> UTCTime time = posixSecondsToUTCTime . fromIntegral
66
time :: Int -> UTCTime time = posixSecondsToUTCTime . fromIntegral
66
time = posixSecondsToUTCTime . fromIntegral
43
false
true
0
5
9
19
10
9
null
null
cutsea110/yesod-pnotify
Yesod/Goodies/PNotify.hs
bsd-3-clause
notifyKey :: Text notifyKey = "_PNotify"
40
notifyKey :: Text notifyKey = "_PNotify"
40
notifyKey = "_PNotify"
22
false
true
0
6
5
18
7
11
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
getFlightHorizontalSpeedStreamReq :: KRPCHS.SpaceCenter.Flight -> KRPCStreamReq (Double) getFlightHorizontalSpeedStreamReq thisArg = let req = makeRequest "SpaceCenter" "Flight_get_HorizontalSpeed" [makeArgument 0 thisArg] in makeStream req
249
getFlightHorizontalSpeedStreamReq :: KRPCHS.SpaceCenter.Flight -> KRPCStreamReq (Double) getFlightHorizontalSpeedStreamReq thisArg = let req = makeRequest "SpaceCenter" "Flight_get_HorizontalSpeed" [makeArgument 0 thisArg] in makeStream req
249
getFlightHorizontalSpeedStreamReq thisArg = let req = makeRequest "SpaceCenter" "Flight_get_HorizontalSpeed" [makeArgument 0 thisArg] in makeStream req
160
false
true
0
11
29
56
27
29
null
null
co-dan/NPNTool
src/NPNTool/PTConstr.hs
bsd-3-clause
mkTrans :: PTConstrM l Trans mkTrans = do c <- get let keyT' = keyT c put $ c { keyT = keyT' + 1 } return $ Trans ("t" ++ show keyT') -- | Specifies a label for some transition
189
mkTrans :: PTConstrM l Trans mkTrans = do c <- get let keyT' = keyT c put $ c { keyT = keyT' + 1 } return $ Trans ("t" ++ show keyT') -- | Specifies a label for some transition
189
mkTrans = do c <- get let keyT' = keyT c put $ c { keyT = keyT' + 1 } return $ Trans ("t" ++ show keyT') -- | Specifies a label for some transition
160
false
true
0
11
53
75
36
39
null
null
flowbox-public/fgl
Data/Graph/Inductive/Graph.hs
bsd-3-clause
-- projecting on context elements -- context1l :: Graph gr => gr a b -> Node -> Maybe (Adj b) context1l = fmap context1l' .: context
132
context1l :: Graph gr => gr a b -> Node -> Maybe (Adj b) context1l = fmap context1l' .: context
95
context1l = fmap context1l' .: context
38
true
true
0
11
25
54
25
29
null
null
osa1/language-lua
src/Language/Lua/Annotated/Simplify.hs
bsd-3-clause
sBinop A.LTE{} = LTE
20
sBinop A.LTE{} = LTE
20
sBinop A.LTE{} = LTE
20
false
false
1
6
3
18
7
11
null
null
dkandalov/katas
haskell/p99/src/p9x/p00/P00.hs
unlicense
dropEveryNth amount list = drop' amount amount list where drop' n counter xs | n < 2 || null xs = [] | counter == 1 = drop' n n (tail xs) | otherwise = (head xs) : (drop' n (counter - 1) (tail xs)) -- P17
253
dropEveryNth amount list = drop' amount amount list where drop' n counter xs | n < 2 || null xs = [] | counter == 1 = drop' n n (tail xs) | otherwise = (head xs) : (drop' n (counter - 1) (tail xs)) -- P17
253
dropEveryNth amount list = drop' amount amount list where drop' n counter xs | n < 2 || null xs = [] | counter == 1 = drop' n n (tail xs) | otherwise = (head xs) : (drop' n (counter - 1) (tail xs)) -- P17
253
false
false
0
10
95
120
57
63
null
null
matthewSorensen/s3-tools
S3sync/Git.hs
bsd-3-clause
filepathFromStrict = fromText . fromChunks . (:[])
50
filepathFromStrict = fromText . fromChunks . (:[])
50
filepathFromStrict = fromText . fromChunks . (:[])
50
false
false
0
7
6
20
11
9
null
null
shlevy/ghc
libraries/base/GHC/Show.hs
bsd-3-clause
showLitChar '\n' s = showString "\\n" s
50
showLitChar '\n' s = showString "\\n" s
50
showLitChar '\n' s = showString "\\n" s
50
false
false
0
5
17
16
7
9
null
null
DanielSchuessler/hstri
Tetrahedron/Triangle.hs
gpl-3.0
allOTriangles :: [OTriangle] allOTriangles = [minBound..maxBound]
65
allOTriangles :: [OTriangle] allOTriangles = [minBound..maxBound]
65
allOTriangles = [minBound..maxBound]
36
false
true
0
5
5
19
11
8
null
null
GaloisInc/smaccmpilot-gcs-gateway
SMACCMPilot/GCS/Gateway/ByteString.hs
bsd-3-clause
bytestringDebugWhen :: (ByteString -> Bool) -> String -> ByteString -> GW ByteString bytestringDebugWhen p tag bs = case p bs of True -> writeDbg msg >> return bs False -> return bs where msg = printf "%s ByteString %d [%s]" tag (B.length bs) body body = fixup (unwords (map hexdig (B.unpack bs))) hexd...
441
bytestringDebugWhen :: (ByteString -> Bool) -> String -> ByteString -> GW ByteString bytestringDebugWhen p tag bs = case p bs of True -> writeDbg msg >> return bs False -> return bs where msg = printf "%s ByteString %d [%s]" tag (B.length bs) body body = fixup (unwords (map hexdig (B.unpack bs))) hexd...
441
bytestringDebugWhen p tag bs = case p bs of True -> writeDbg msg >> return bs False -> return bs where msg = printf "%s ByteString %d [%s]" tag (B.length bs) body body = fixup (unwords (map hexdig (B.unpack bs))) hexdig = printf "0x%0.2x," -- Drop last char because the above map/unwords is bad hack ...
354
false
true
0
12
96
152
74
78
null
null
kfiz/IHaskell
ipython-kernel/src/IHaskell/IPython/Types.hs
mit
showMessageType DisplayDataMessage = "display_data"
51
showMessageType DisplayDataMessage = "display_data"
51
showMessageType DisplayDataMessage = "display_data"
51
false
false
0
5
3
9
4
5
null
null
thoughtpolice/hs-leveldb
examples/hl_test.hs
bsd-3-clause
say :: MonadIO m => String -> m () say x = say_ $ "===== " ++ x ++ " ====="
75
say :: MonadIO m => String -> m () say x = say_ $ "===== " ++ x ++ " ====="
75
say x = say_ $ "===== " ++ x ++ " ====="
40
false
true
4
9
20
48
21
27
null
null
kaoskorobase/mescaline
lib/mescaline/Mescaline/Data/ByteString.hs
gpl-3.0
toLazy :: BS.ByteString -> BL.ByteString toLazy s = BL.fromChunks [s]
69
toLazy :: BS.ByteString -> BL.ByteString toLazy s = BL.fromChunks [s]
69
toLazy s = BL.fromChunks [s]
28
false
true
0
8
9
35
16
19
null
null
SeanRBurton/aeson
Data/Aeson/Types/Instances.hs
bsd-3-clause
-- | @withScientific expected f value@ applies @f@ to the 'Scientific' number when @value@ is a 'Number'. -- and fails using @'typeMismatch' expected@ otherwise. withScientific :: String -> (Scientific -> Parser a) -> Value -> Parser a withScientific _ f (Number scientific) = f scientific
298
withScientific :: String -> (Scientific -> Parser a) -> Value -> Parser a withScientific _ f (Number scientific) = f scientific
134
withScientific _ f (Number scientific) = f scientific
60
true
true
0
9
53
54
27
27
null
null
shouya/thinking-dumps
discrete-optimization/knapsack/solver.hs
mit
greedy :: (Item -> Item -> Ordering) -> Weight -> [Item] -> Solution greedy f w items = takeItem w items [] where sortedItem = sortBy f items takeItem _ [] carry = carry takeItem wleft (i:is) carry = if itemweight i <= wleft then takeItem (wleft - (itemweight i)) is (i:carry) els...
345
greedy :: (Item -> Item -> Ordering) -> Weight -> [Item] -> Solution greedy f w items = takeItem w items [] where sortedItem = sortBy f items takeItem _ [] carry = carry takeItem wleft (i:is) carry = if itemweight i <= wleft then takeItem (wleft - (itemweight i)) is (i:carry) els...
345
greedy f w items = takeItem w items [] where sortedItem = sortBy f items takeItem _ [] carry = carry takeItem wleft (i:is) carry = if itemweight i <= wleft then takeItem (wleft - (itemweight i)) is (i:carry) else takeItem wleft is carry
276
false
true
0
10
96
148
75
73
null
null
andorp/grin
grin/src/Test/Check.hs
bsd-3-clause
patsInAlts :: (Monoid m) => (CPat -> m) -> Exp -> m patsInAlts f = cata $ \case AltF pat val -> (f pat <> val) rest -> Foldable.fold rest
149
patsInAlts :: (Monoid m) => (CPat -> m) -> Exp -> m patsInAlts f = cata $ \case AltF pat val -> (f pat <> val) rest -> Foldable.fold rest
149
patsInAlts f = cata $ \case AltF pat val -> (f pat <> val) rest -> Foldable.fold rest
97
false
true
4
10
41
74
37
37
null
null
cosmo0920/Ahblog
devel.hs
mit
main :: IO () main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app loop
171
main :: IO () main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app loop
171
main = do putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app loop
157
false
true
0
10
38
58
27
31
null
null
sgillespie/lambda-calculus
src/Language/SystemF/Parser.hs
mit
arrow :: Parser (Ty String) arrow = chainr1 tyterm (symbol' "->" $> TyArrow)
76
arrow :: Parser (Ty String) arrow = chainr1 tyterm (symbol' "->" $> TyArrow)
76
arrow = chainr1 tyterm (symbol' "->" $> TyArrow)
48
false
true
1
8
12
38
17
21
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | Type of rich media asset. This is a read-only field. Applicable to the -- following creative types: all RICH_MEDIA. caaDisplayType :: Lens' CreativeAsset (Maybe CreativeAssetDisplayType) caaDisplayType = lens _caaDisplayType (\ s a -> s{_caaDisplayType = a})
271
caaDisplayType :: Lens' CreativeAsset (Maybe CreativeAssetDisplayType) caaDisplayType = lens _caaDisplayType (\ s a -> s{_caaDisplayType = a})
150
caaDisplayType = lens _caaDisplayType (\ s a -> s{_caaDisplayType = a})
79
true
true
1
9
45
52
26
26
null
null
siphilia/str2hex
app/Main.hs
bsd-3-clause
displayHelp :: IO () displayHelp = TIO.putStrLn [st|Usage: str2hex ENCODING [TEXT | -] Available encodings: * utf8 * utf16le * utf16be * utf32le * utf32be |]
178
displayHelp :: IO () displayHelp = TIO.putStrLn [st|Usage: str2hex ENCODING [TEXT | -] Available encodings: * utf8 * utf16le * utf16be * utf32le * utf32be |]
178
displayHelp = TIO.putStrLn [st|Usage: str2hex ENCODING [TEXT | -] Available encodings: * utf8 * utf16le * utf16be * utf32le * utf32be |]
157
false
true
0
6
46
25
14
11
null
null
clanehin/priority-sync
PrioritySync/Internal/Queue.hs
bsd-3-clause
dispatchTasks :: (Ord a) => [(Queue a,a,STM ())] -> IO [TaskHandle a] dispatchTasks task_records = do tasks <- mapM (\(q,a,actionSTM) -> atomically $ putTask q a actionSTM) task_records _ <- forkIO $ pullSpecificTasks tasks return tasks -- | Process a 'Queue' until it is empty.
298
dispatchTasks :: (Ord a) => [(Queue a,a,STM ())] -> IO [TaskHandle a] dispatchTasks task_records = do tasks <- mapM (\(q,a,actionSTM) -> atomically $ putTask q a actionSTM) task_records _ <- forkIO $ pullSpecificTasks tasks return tasks -- | Process a 'Queue' until it is empty.
298
dispatchTasks task_records = do tasks <- mapM (\(q,a,actionSTM) -> atomically $ putTask q a actionSTM) task_records _ <- forkIO $ pullSpecificTasks tasks return tasks -- | Process a 'Queue' until it is empty.
228
false
true
0
12
64
117
59
58
null
null
diagrams/diagrams-reflex
src/Graphics/Rendering/Reflex.hs
bsd-3-clause
renderLineWidth :: Style v Double -> Attrs renderLineWidth s = renderAttr "stroke-width" lWidth where lWidth = getNumAttr getLineWidth s
138
renderLineWidth :: Style v Double -> Attrs renderLineWidth s = renderAttr "stroke-width" lWidth where lWidth = getNumAttr getLineWidth s
138
renderLineWidth s = renderAttr "stroke-width" lWidth where lWidth = getNumAttr getLineWidth s
95
false
true
0
6
20
41
19
22
null
null
larioj/nemo
app/Main.hs
mit
status :: FilePath -> IO () status projectRoot = Read.getNemo projectRoot >>= \old -> showNewFiles old (Update.update old)
130
status :: FilePath -> IO () status projectRoot = Read.getNemo projectRoot >>= \old -> showNewFiles old (Update.update old)
130
status projectRoot = Read.getNemo projectRoot >>= \old -> showNewFiles old (Update.update old)
102
false
true
0
10
25
50
24
26
null
null
snoyberg/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
callishOp FloatAtanOp = Just MO_F32_Atan
42
callishOp FloatAtanOp = Just MO_F32_Atan
42
callishOp FloatAtanOp = Just MO_F32_Atan
42
false
false
0
5
6
12
5
7
null
null
llllllllll/Math.Diophantine
Math/Diophantine/Parser.hs
gpl-2.0
findY2Coef (ETerm (Variable n YTerm 2)) m = n + m
54
findY2Coef (ETerm (Variable n YTerm 2)) m = n + m
54
findY2Coef (ETerm (Variable n YTerm 2)) m = n + m
54
false
false
0
9
15
31
15
16
null
null
danr/hipspec
testsuite/prod/zeno_version/PropT01.hs
gpl-3.0
elem :: Nat -> [Nat] -> Bool elem _ [] = False
46
elem :: Nat -> [Nat] -> Bool elem _ [] = False
46
elem _ [] = False
17
false
true
0
7
11
29
15
14
null
null