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
jonathan-laurent/copilot-kind
src/Copilot/Kind/TransSys/PrettyPrint.hs
bsd-3-clause
-------------------------------------------------------------------------------- indent = nest 4
103
indent = nest 4
19
indent = nest 4
19
true
false
0
5
11
10
5
5
null
null
spechub/Hets
Interfaces/Command.hs
gpl-2.0
showCmd :: Command -> String showCmd c = let cn = cmdNameStr c in case c of SelectCmd _ t -> cn ++ " " ++ t TimeLimit l -> cn ++ " " ++ show l SetAxioms as -> unwords $ cn : as CommentCmd s -> cn ++ s GroupCmd l -> intercalate "\n" $ map showCmd l InspectCmd _ t -> cn ++ " " ++ fromMaybe "" t ChangeCmd _ t -> cmdNameStr c ++ " " ++ t ShowOutput b -> cn ++ show b _ -> cn
390
showCmd :: Command -> String showCmd c = let cn = cmdNameStr c in case c of SelectCmd _ t -> cn ++ " " ++ t TimeLimit l -> cn ++ " " ++ show l SetAxioms as -> unwords $ cn : as CommentCmd s -> cn ++ s GroupCmd l -> intercalate "\n" $ map showCmd l InspectCmd _ t -> cn ++ " " ++ fromMaybe "" t ChangeCmd _ t -> cmdNameStr c ++ " " ++ t ShowOutput b -> cn ++ show b _ -> cn
390
showCmd c = let cn = cmdNameStr c in case c of SelectCmd _ t -> cn ++ " " ++ t TimeLimit l -> cn ++ " " ++ show l SetAxioms as -> unwords $ cn : as CommentCmd s -> cn ++ s GroupCmd l -> intercalate "\n" $ map showCmd l InspectCmd _ t -> cn ++ " " ++ fromMaybe "" t ChangeCmd _ t -> cmdNameStr c ++ " " ++ t ShowOutput b -> cn ++ show b _ -> cn
361
false
true
0
12
110
200
90
110
null
null
qnikst/distributed-process
src/Control/Distributed/Process/Internal/Closure/Explicit.hs
bsd-3-clause
call' :: forall a. Serializable a => NodeId -> Closure (Process a) -> Process a call' = call (staticLabel $ (show $ typeOf $ (undefined :: a)) ++ "__staticDict")
161
call' :: forall a. Serializable a => NodeId -> Closure (Process a) -> Process a call' = call (staticLabel $ (show $ typeOf $ (undefined :: a)) ++ "__staticDict")
161
call' = call (staticLabel $ (show $ typeOf $ (undefined :: a)) ++ "__staticDict")
81
false
true
0
12
28
80
39
41
null
null
mightymoose/liquidhaskell
benchmarks/ghc-7.4.1/IO/Encoding/UTF8.hs
bsd-3-clause
utf8_DF :: CodingFailureMode -> IO (TextDecoder ()) utf8_DF cfm = return (BufferCodec { encode = utf8_decode, recover = recoverDecode cfm, close = return (), getState = return (), setState = const $ return () })
294
utf8_DF :: CodingFailureMode -> IO (TextDecoder ()) utf8_DF cfm = return (BufferCodec { encode = utf8_decode, recover = recoverDecode cfm, close = return (), getState = return (), setState = const $ return () })
294
utf8_DF cfm = return (BufferCodec { encode = utf8_decode, recover = recoverDecode cfm, close = return (), getState = return (), setState = const $ return () })
242
false
true
0
11
117
94
48
46
null
null
mboes/hs-asn1
data/Data/ASN1/Parse.hs
bsd-3-clause
onNextContainer :: ASN1ConstructionType -> ParseASN1 a -> ParseASN1 a onNextContainer ty f = getNextContainer ty >>= either throwError return . runParseASN1 f
158
onNextContainer :: ASN1ConstructionType -> ParseASN1 a -> ParseASN1 a onNextContainer ty f = getNextContainer ty >>= either throwError return . runParseASN1 f
158
onNextContainer ty f = getNextContainer ty >>= either throwError return . runParseASN1 f
88
false
true
0
7
21
49
22
27
null
null
crogers1/manager
xenmgr/XenMgr/Errors.hs
gpl-2.0
failCannotStartHdxWithoutVtD :: (MonadError XmError m) => m a failCannotStartHdxWithoutVtD = throwError $ XError 211 "Cannot start VM with HDX because VT-d is turned off."
171
failCannotStartHdxWithoutVtD :: (MonadError XmError m) => m a failCannotStartHdxWithoutVtD = throwError $ XError 211 "Cannot start VM with HDX because VT-d is turned off."
171
failCannotStartHdxWithoutVtD = throwError $ XError 211 "Cannot start VM with HDX because VT-d is turned off."
109
false
true
0
6
23
34
17
17
null
null
kyagrd/hs-nipkow-lics93
src/Syntax.hs
bsd-2-clause
stepWH v@(B _) = pure v
33
stepWH v@(B _) = pure v
33
stepWH v@(B _) = pure v
33
false
false
1
8
15
25
10
15
null
null
bmjames/hakyll-sandbox
css/default.hs
bsd-3-clause
main :: IO () main = putCss defaultStyle
40
main :: IO () main = putCss defaultStyle
40
main = putCss defaultStyle
26
false
true
0
7
7
25
10
15
null
null
mettekou/ghc
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
genLoad atomic e@(CmmRegOff (CmmGlobal r) n) ty = genLoad_fast atomic e r n ty
82
genLoad atomic e@(CmmRegOff (CmmGlobal r) n) ty = genLoad_fast atomic e r n ty
82
genLoad atomic e@(CmmRegOff (CmmGlobal r) n) ty = genLoad_fast atomic e r n ty
82
false
false
0
10
17
41
20
21
null
null
skogsbaer/HTF
Test/Framework/HUnitWrapper.hs
lgpl-2.1
equalityFailedMessage :: (Show a) => a -> a -> ColorString equalityFailedMessage exp act = equalityFailedMessage' expP actP where (expP, actP) = case (asString exp, asString act) of (Just expS, Just actS) | expS /= actS -> (expS, actS) _ -> case (prettyHaskell' exp, prettyHaskell' act) of (Nothing, _) -> (show exp, show act) (_, Nothing) -> (show exp, show act) (Just expP, Just actP) | expP == actP -> (show exp, show act) | otherwise -> (expP, actP)
619
equalityFailedMessage :: (Show a) => a -> a -> ColorString equalityFailedMessage exp act = equalityFailedMessage' expP actP where (expP, actP) = case (asString exp, asString act) of (Just expS, Just actS) | expS /= actS -> (expS, actS) _ -> case (prettyHaskell' exp, prettyHaskell' act) of (Nothing, _) -> (show exp, show act) (_, Nothing) -> (show exp, show act) (Just expP, Just actP) | expP == actP -> (show exp, show act) | otherwise -> (expP, actP)
619
equalityFailedMessage exp act = equalityFailedMessage' expP actP where (expP, actP) = case (asString exp, asString act) of (Just expS, Just actS) | expS /= actS -> (expS, actS) _ -> case (prettyHaskell' exp, prettyHaskell' act) of (Nothing, _) -> (show exp, show act) (_, Nothing) -> (show exp, show act) (Just expP, Just actP) | expP == actP -> (show exp, show act) | otherwise -> (expP, actP)
560
false
true
0
14
243
228
116
112
null
null
ekarayel/HTF
Test/Framework/TestManager.hs
lgpl-2.1
mkFlatTestRunner :: TestConfig -> FlatTest -> ThreadPoolEntry TR () (PrimTestResult, Milliseconds) mkFlatTestRunner tc ft = (pre, action, post) where pre = reportTestStart ft action _ = let run = performTestHTF (wto_payload (ft_payload ft)) in case maxRunTime tc ft of Nothing -> do (res, time) <- measure run return (PrimTestResultNoTimeout res, time) Just maxMs -> do mx <- timeout (1000 * maxMs) $ measure run case mx of Nothing -> return (PrimTestResultTimeout, maxMs) Just (res, time) -> return (PrimTestResultNoTimeout res, time) post excOrResult = let (testResult, time) = case excOrResult of Left exc -> (FullTestResult { ftr_location = Nothing , ftr_callingLocations = [] , ftr_message = Just $ noColor ("Running test unexpectedly failed: " ++ show exc) , ftr_result = Just Error } ,(-1)) Right (res, time) -> case res of PrimTestResultTimeout -> (FullTestResult { ftr_location = Nothing , ftr_callingLocations = [] , ftr_message = Just $ colorize warningColor "timeout" , ftr_result = Nothing } ,time) PrimTestResultNoTimeout res -> let res' = if isNothing (ftr_message res) && isNothing (ftr_result res) then res { ftr_message = Just (colorize warningColor "timeout") } else res in (res', time) (sumRes, isTimeout) = case ftr_result testResult of Just x -> (x, False) Nothing -> (if tc_timeoutIsSuccess tc then Pass else Error, True) rr = FlatTest { ft_sort = ft_sort ft , ft_path = ft_path ft , ft_location = ft_location ft , ft_payload = RunResult sumRes (ftr_location testResult) (ftr_callingLocations testResult) (fromMaybe emptyColorString (ftr_message testResult)) time isTimeout } in do modify (\s -> s { ts_results = rr : ts_results s }) reportTestResult rr return (stopFlag sumRes) stopFlag result = if not (tc_failFast tc) then DoNotStop else case result of Pass -> DoNotStop Pending -> DoNotStop Fail -> DoStop Error -> DoStop
3,240
mkFlatTestRunner :: TestConfig -> FlatTest -> ThreadPoolEntry TR () (PrimTestResult, Milliseconds) mkFlatTestRunner tc ft = (pre, action, post) where pre = reportTestStart ft action _ = let run = performTestHTF (wto_payload (ft_payload ft)) in case maxRunTime tc ft of Nothing -> do (res, time) <- measure run return (PrimTestResultNoTimeout res, time) Just maxMs -> do mx <- timeout (1000 * maxMs) $ measure run case mx of Nothing -> return (PrimTestResultTimeout, maxMs) Just (res, time) -> return (PrimTestResultNoTimeout res, time) post excOrResult = let (testResult, time) = case excOrResult of Left exc -> (FullTestResult { ftr_location = Nothing , ftr_callingLocations = [] , ftr_message = Just $ noColor ("Running test unexpectedly failed: " ++ show exc) , ftr_result = Just Error } ,(-1)) Right (res, time) -> case res of PrimTestResultTimeout -> (FullTestResult { ftr_location = Nothing , ftr_callingLocations = [] , ftr_message = Just $ colorize warningColor "timeout" , ftr_result = Nothing } ,time) PrimTestResultNoTimeout res -> let res' = if isNothing (ftr_message res) && isNothing (ftr_result res) then res { ftr_message = Just (colorize warningColor "timeout") } else res in (res', time) (sumRes, isTimeout) = case ftr_result testResult of Just x -> (x, False) Nothing -> (if tc_timeoutIsSuccess tc then Pass else Error, True) rr = FlatTest { ft_sort = ft_sort ft , ft_path = ft_path ft , ft_location = ft_location ft , ft_payload = RunResult sumRes (ftr_location testResult) (ftr_callingLocations testResult) (fromMaybe emptyColorString (ftr_message testResult)) time isTimeout } in do modify (\s -> s { ts_results = rr : ts_results s }) reportTestResult rr return (stopFlag sumRes) stopFlag result = if not (tc_failFast tc) then DoNotStop else case result of Pass -> DoNotStop Pending -> DoNotStop Fail -> DoStop Error -> DoStop
3,240
mkFlatTestRunner tc ft = (pre, action, post) where pre = reportTestStart ft action _ = let run = performTestHTF (wto_payload (ft_payload ft)) in case maxRunTime tc ft of Nothing -> do (res, time) <- measure run return (PrimTestResultNoTimeout res, time) Just maxMs -> do mx <- timeout (1000 * maxMs) $ measure run case mx of Nothing -> return (PrimTestResultTimeout, maxMs) Just (res, time) -> return (PrimTestResultNoTimeout res, time) post excOrResult = let (testResult, time) = case excOrResult of Left exc -> (FullTestResult { ftr_location = Nothing , ftr_callingLocations = [] , ftr_message = Just $ noColor ("Running test unexpectedly failed: " ++ show exc) , ftr_result = Just Error } ,(-1)) Right (res, time) -> case res of PrimTestResultTimeout -> (FullTestResult { ftr_location = Nothing , ftr_callingLocations = [] , ftr_message = Just $ colorize warningColor "timeout" , ftr_result = Nothing } ,time) PrimTestResultNoTimeout res -> let res' = if isNothing (ftr_message res) && isNothing (ftr_result res) then res { ftr_message = Just (colorize warningColor "timeout") } else res in (res', time) (sumRes, isTimeout) = case ftr_result testResult of Just x -> (x, False) Nothing -> (if tc_timeoutIsSuccess tc then Pass else Error, True) rr = FlatTest { ft_sort = ft_sort ft , ft_path = ft_path ft , ft_location = ft_location ft , ft_payload = RunResult sumRes (ftr_location testResult) (ftr_callingLocations testResult) (fromMaybe emptyColorString (ftr_message testResult)) time isTimeout } in do modify (\s -> s { ts_results = rr : ts_results s }) reportTestResult rr return (stopFlag sumRes) stopFlag result = if not (tc_failFast tc) then DoNotStop else case result of Pass -> DoNotStop Pending -> DoNotStop Fail -> DoStop Error -> DoStop
3,141
false
true
17
17
1,675
681
357
324
null
null
tibbe/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprImm (ImmCLbl l) = ppr l
29
pprImm (ImmCLbl l) = ppr l
29
pprImm (ImmCLbl l) = ppr l
29
false
false
0
6
8
19
8
11
null
null
Docteur-Lalla/HsSHAUN
src/Shaun/Syntax/Lexer.hs
bsd-3-clause
-- |Reads an identifier (same rules as C's identifiers) readIdentifier :: String -> Lexer Token readIdentifier "" = Left "expected letter or underscore"
156
readIdentifier :: String -> Lexer Token readIdentifier "" = Left "expected letter or underscore"
96
readIdentifier "" = Left "expected letter or underscore"
56
true
true
0
7
26
29
13
16
null
null
johanneshilden/principle
Trombone/Parse.hs
bsd-3-clause
routeOrBlock :: GenParser Char st [Route] routeOrBlock = try route <|> dryBlock
79
routeOrBlock :: GenParser Char st [Route] routeOrBlock = try route <|> dryBlock
79
routeOrBlock = try route <|> dryBlock
37
false
true
1
6
11
31
14
17
null
null
pharaun/hsnsq
src/Network/NSQ/Parser.hs
apache-2.0
encode (Touch msg_id) = BL.toStrict $ BL.toLazyByteString ( BL.byteString "TOUCH " <> BL.byteString msg_id <> BL.byteString "\n" )
158
encode (Touch msg_id) = BL.toStrict $ BL.toLazyByteString ( BL.byteString "TOUCH " <> BL.byteString msg_id <> BL.byteString "\n" )
158
encode (Touch msg_id) = BL.toStrict $ BL.toLazyByteString ( BL.byteString "TOUCH " <> BL.byteString msg_id <> BL.byteString "\n" )
158
false
false
0
11
45
53
24
29
null
null
green-haskell/ghc
compiler/hsSyn/HsTypes.hs
bsd-3-clause
pprHsContextExtra True = \ctxt -> case ctxt of [] -> char '_' <+> darrow _ -> parens (sep (punctuate comma ctxt')) <+> darrow where ctxt' = map ppr ctxt ++ [char '_']
216
pprHsContextExtra True = \ctxt -> case ctxt of [] -> char '_' <+> darrow _ -> parens (sep (punctuate comma ctxt')) <+> darrow where ctxt' = map ppr ctxt ++ [char '_']
216
pprHsContextExtra True = \ctxt -> case ctxt of [] -> char '_' <+> darrow _ -> parens (sep (punctuate comma ctxt')) <+> darrow where ctxt' = map ppr ctxt ++ [char '_']
216
false
false
0
14
81
82
40
42
null
null
phadej/stack
src/Stack/Config.hs
bsd-3-clause
loadConfigYaml :: (FromJSON (WithJSONWarnings a), MonadIO m, MonadLogger m) => Path Abs File -> m a loadConfigYaml path = do eres <- loadYaml path case eres of Left err -> liftIO $ throwM (ParseConfigFileException path err) Right res -> return res -- | Load and parse YAML from the given file.
326
loadConfigYaml :: (FromJSON (WithJSONWarnings a), MonadIO m, MonadLogger m) => Path Abs File -> m a loadConfigYaml path = do eres <- loadYaml path case eres of Left err -> liftIO $ throwM (ParseConfigFileException path err) Right res -> return res -- | Load and parse YAML from the given file.
326
loadConfigYaml path = do eres <- loadYaml path case eres of Left err -> liftIO $ throwM (ParseConfigFileException path err) Right res -> return res -- | Load and parse YAML from the given file.
218
false
true
0
13
83
107
50
57
null
null
sdiehl/ghc
compiler/basicTypes/VarSet.hs
bsd-3-clause
intersectVarSet = intersectUniqSets
35
intersectVarSet = intersectUniqSets
35
intersectVarSet = intersectUniqSets
35
false
false
0
4
2
6
3
3
null
null
flowbox-public/accelerate-cuda
Data/Array/Accelerate/CUDA/CodeGen/Reduction.hs
bsd-3-clause
shflOK :: Elt e => DeviceProperties -> e -> Bool shflOK _dev _ = False
70
shflOK :: Elt e => DeviceProperties -> e -> Bool shflOK _dev _ = False
70
shflOK _dev _ = False
21
false
true
0
7
14
31
15
16
null
null
mpickering/ghc-exactprint
tests/examples/transform/AddLocalDecl6.hs
bsd-3-clause
-- comment 0 foo xs = 2
23
foo xs = 2
10
foo xs = 2
10
true
false
0
5
6
10
5
5
null
null
garethrowlands/marsrover
spec/ParserSpec.hs
bsd-3-clause
-- |Run the given parser against the given 'String', returning -- 'Either' the successfully parsed value or the 'String' part of the error message. -- Trims any trailing newlines off the error. parseStr :: CharParser () a -> String -> Either String a parseStr p input = case parse p "" input of Left parseError -> Left . trimNewlines . show $ parseError Right parsedValue -> Right parsedValue -- |Removes any trailing newlines
459
parseStr :: CharParser () a -> String -> Either String a parseStr p input = case parse p "" input of Left parseError -> Left . trimNewlines . show $ parseError Right parsedValue -> Right parsedValue -- |Removes any trailing newlines
265
parseStr p input = case parse p "" input of Left parseError -> Left . trimNewlines . show $ parseError Right parsedValue -> Right parsedValue -- |Removes any trailing newlines
208
true
true
0
10
105
84
41
43
null
null
zoomhub/zoomhub
vendor/servant/servant-server/test/Servant/Server/ErrorSpec.hs
mit
spec :: Spec spec = describe "HTTP Errors" $ do errorOrderSpec prioErrorsSpec errorRetrySpec errorChoiceSpec -- * Auth machinery (reused throughout) -- | 'BasicAuthCheck' holds the handler we'll use to verify a username and password.
251
spec :: Spec spec = describe "HTTP Errors" $ do errorOrderSpec prioErrorsSpec errorRetrySpec errorChoiceSpec -- * Auth machinery (reused throughout) -- | 'BasicAuthCheck' holds the handler we'll use to verify a username and password.
251
spec = describe "HTTP Errors" $ do errorOrderSpec prioErrorsSpec errorRetrySpec errorChoiceSpec -- * Auth machinery (reused throughout) -- | 'BasicAuthCheck' holds the handler we'll use to verify a username and password.
238
false
true
2
7
51
40
16
24
null
null
acowley/ghc
compiler/prelude/THNames.hs
bsd-3-clause
namedWildCardTIdKey = mkPreludeMiscIdUnique 396
47
namedWildCardTIdKey = mkPreludeMiscIdUnique 396
47
namedWildCardTIdKey = mkPreludeMiscIdUnique 396
47
false
false
0
5
3
9
4
5
null
null
rumuki/rumuki-server
src/Application.hs
gpl-3.0
getApplicationPrerequisites :: IO (App, Settings, Application) getApplicationPrerequisites = do settings <- getAppSettings foundation <- makeFoundation settings wsettings <- getDevSettings $ warpSettings foundation app <- makeApplication foundation return (foundation, wsettings, app)
294
getApplicationPrerequisites :: IO (App, Settings, Application) getApplicationPrerequisites = do settings <- getAppSettings foundation <- makeFoundation settings wsettings <- getDevSettings $ warpSettings foundation app <- makeApplication foundation return (foundation, wsettings, app)
294
getApplicationPrerequisites = do settings <- getAppSettings foundation <- makeFoundation settings wsettings <- getDevSettings $ warpSettings foundation app <- makeApplication foundation return (foundation, wsettings, app)
231
false
true
0
9
39
79
38
41
null
null
apyrgio/snf-ganeti
src/Ganeti/Constants.hs
bsd-2-clause
idiskMode :: String idiskMode = "mode"
38
idiskMode :: String idiskMode = "mode"
38
idiskMode = "mode"
18
false
true
0
4
5
11
6
5
null
null
wjt/bustle
GetText.hs
lgpl-2.1
findInParametersDefault :: [(String, String)] -> String -> String -> String findInParametersDefault al name def = (fromMaybe def . lookup name) al
146
findInParametersDefault :: [(String, String)] -> String -> String -> String findInParametersDefault al name def = (fromMaybe def . lookup name) al
146
findInParametersDefault al name def = (fromMaybe def . lookup name) al
70
false
true
0
8
20
55
28
27
null
null
brendanhay/gogol
gogol-tagmanager/gen/Network/Google/TagManager/Types/Product.hs
mpl-2.0
-- | True if type restrictions have been enabled for this Zone. ztrEnable :: Lens' ZoneTypeRestriction (Maybe Bool) ztrEnable = lens _ztrEnable (\ s a -> s{_ztrEnable = a})
174
ztrEnable :: Lens' ZoneTypeRestriction (Maybe Bool) ztrEnable = lens _ztrEnable (\ s a -> s{_ztrEnable = a})
110
ztrEnable = lens _ztrEnable (\ s a -> s{_ztrEnable = a})
58
true
true
1
9
30
50
25
25
null
null
taphu/moonshine
src/Web/Moonshine.hs
apache-2.0
defaultServerConfig :: ServerConfig defaultServerConfig = ServerConfig { adminConnector = [ConnectorConfig {scheme=HTTP, port=8001, cert=Nothing, key=Nothing}] , applicationConnector = [ConnectorConfig {scheme=HTTP, port=8000, cert=Nothing, key=Nothing}] }
264
defaultServerConfig :: ServerConfig defaultServerConfig = ServerConfig { adminConnector = [ConnectorConfig {scheme=HTTP, port=8001, cert=Nothing, key=Nothing}] , applicationConnector = [ConnectorConfig {scheme=HTTP, port=8000, cert=Nothing, key=Nothing}] }
264
defaultServerConfig = ServerConfig { adminConnector = [ConnectorConfig {scheme=HTTP, port=8001, cert=Nothing, key=Nothing}] , applicationConnector = [ConnectorConfig {scheme=HTTP, port=8000, cert=Nothing, key=Nothing}] }
228
false
true
0
9
30
83
53
30
null
null
balez/ag-a-la-carte
Language/Grammars/AGalacarte/Examples/Repmin.hs
gpl-3.0
extree :: TreeT extree = (l 2 * ((l 3 * l 2) * l 5)) * ((l 2 * l 4) * l 7) where l = leaf (*) = node -- * In order labelling
145
extree :: TreeT extree = (l 2 * ((l 3 * l 2) * l 5)) * ((l 2 * l 4) * l 7) where l = leaf (*) = node -- * In order labelling
145
extree = (l 2 * ((l 3 * l 2) * l 5)) * ((l 2 * l 4) * l 7) where l = leaf (*) = node -- * In order labelling
129
false
true
3
11
57
101
46
55
null
null
jhartikainen/hs-language-php
Evaluator.hs
bsd-3-clause
stmtVal :: PHPStmt -> PHPValue stmtVal (Expression e) = exprVal e
65
stmtVal :: PHPStmt -> PHPValue stmtVal (Expression e) = exprVal e
65
stmtVal (Expression e) = exprVal e
34
false
true
0
7
10
27
13
14
null
null
HIPERFIT/futhark
src/Futhark/CodeGen/ImpGen/GPU/Base.hs
isc
kernelAlloc :: Pat GPUMem -> SubExp -> Space -> InKernelGen () kernelAlloc (Pat [_]) _ ScalarSpace {} = -- Handled by the declaration of the memory block, which is then -- translated to an actual scalar variable during C code generation. return ()
261
kernelAlloc :: Pat GPUMem -> SubExp -> Space -> InKernelGen () kernelAlloc (Pat [_]) _ ScalarSpace {} = -- Handled by the declaration of the memory block, which is then -- translated to an actual scalar variable during C code generation. return ()
261
kernelAlloc (Pat [_]) _ ScalarSpace {} = -- Handled by the declaration of the memory block, which is then -- translated to an actual scalar variable during C code generation. return ()
190
false
true
0
9
56
58
29
29
null
null
GaloisInc/sk-dev-platform
libs/SCD/src/SCD/Lobster/Symbolic/Lobster.hs
bsd-3-clause
systemCommand :: String -> IO ExitCode -> M ExitCode systemCommand cmd io = do d <- currentProcessName p <- gensym "p" lift $ sio ( io , justStmts [ mkProcInstance p (takeWhile (not . isSpace) cmd) , active d ==> createPort p , active p === child d ] )
361
systemCommand :: String -> IO ExitCode -> M ExitCode systemCommand cmd io = do d <- currentProcessName p <- gensym "p" lift $ sio ( io , justStmts [ mkProcInstance p (takeWhile (not . isSpace) cmd) , active d ==> createPort p , active p === child d ] )
361
systemCommand cmd io = do d <- currentProcessName p <- gensym "p" lift $ sio ( io , justStmts [ mkProcInstance p (takeWhile (not . isSpace) cmd) , active d ==> createPort p , active p === child d ] )
308
false
true
0
17
158
120
55
65
null
null
ulricha/dsh
src/Database/DSH/VSL/Opt/Properties/Segments.hs
bsd-3-clause
flatInputs SegdP _ = pure SegdP
41
flatInputs SegdP _ = pure SegdP
41
flatInputs SegdP _ = pure SegdP
41
false
false
0
5
15
16
6
10
null
null
nomeata/ghc
compiler/main/DriverPhases.hs
bsd-3-clause
dynlib_suffixes = ["dll", "DLL"]
32
dynlib_suffixes = ["dll", "DLL"]
32
dynlib_suffixes = ["dll", "DLL"]
32
false
false
0
5
3
12
7
5
null
null
jaiyalas/creepy-waffle
_useless/Event.hs
mit
main_vps :: M.ViewportScroll main_vps = M.viewportScroll main_vpn
65
main_vps :: M.ViewportScroll main_vps = M.viewportScroll main_vpn
65
main_vps = M.viewportScroll main_vpn
36
false
true
0
6
6
18
9
9
null
null
bos/pcap
Network/Pcap.hs
bsd-3-clause
-- | Return the blocking status of the 'PcapHandle'. 'True' indicates -- that the handle is non-blocking. Handles referring to dump files -- opened by 'openDump' always return 'False'. getNonBlock :: PcapHandle -> IO Bool getNonBlock pch = withPcap pch P.getNonBlock
266
getNonBlock :: PcapHandle -> IO Bool getNonBlock pch = withPcap pch P.getNonBlock
81
getNonBlock pch = withPcap pch P.getNonBlock
44
true
true
0
6
40
31
16
15
null
null
failx/knapsack
Keys.hs
unlicense
generateR a = let x = rndMinMax 1 (a-1) in if euclid x a == 1 then x else generateR a
147
generateR a = let x = rndMinMax 1 (a-1) in if euclid x a == 1 then x else generateR a
147
generateR a = let x = rndMinMax 1 (a-1) in if euclid x a == 1 then x else generateR a
147
false
false
0
11
82
52
25
27
null
null
gnn/Hets
OWL2/XMLConversion.hs
gpl-2.0
nullElem :: Element nullElem = Element nullQN [] [] Nothing
59
nullElem :: Element nullElem = Element nullQN [] [] Nothing
59
nullElem = Element nullQN [] [] Nothing
39
false
true
0
6
9
24
12
12
null
null
EduPH/ModelosComputacionales
src/MacrosNew.hs
bsd-3-clause
-- | La función (indexEt e) devuelve el índice de la etiqueta e. indexEt :: Etiqueta -> Int indexEt (E _ n) = n
112
indexEt :: Etiqueta -> Int indexEt (E _ n) = n
46
indexEt (E _ n) = n
19
true
true
0
6
24
31
15
16
null
null
lamdu/lamdu
src/Lamdu/Sugar/Convert/Definition.hs
gpl-3.0
pane :: (Has Debug.Monitors env, Has Cache.Functions env, Has Config env, Monad m, Typeable m, Anchors.HasCodeAnchors env m) => env -> DefI m -> OnceT (T m) (PaneBody EvalPrep InternalName (OnceT (T m)) (T m) ([EntityId], ConvertPayload m)) pane env defI = Definition <$> (ConvertTag.taggedEntityWith (env ^. Anchors.codeAnchors) Nothing defVar & join) <*> pure defVar <*> (ExprLoad.def defI & lift <&> Definition.defPayload .~ defI >>= convertDefBody env) ?? (nextOutdatedDef (env ^. Anchors.codeAnchors) defI >>= Lens._Just (jumpToDefinition (env ^. Anchors.codeAnchors))) <&> PaneDefinition where defVar = ExprIRef.globalId defI
683
pane :: (Has Debug.Monitors env, Has Cache.Functions env, Has Config env, Monad m, Typeable m, Anchors.HasCodeAnchors env m) => env -> DefI m -> OnceT (T m) (PaneBody EvalPrep InternalName (OnceT (T m)) (T m) ([EntityId], ConvertPayload m)) pane env defI = Definition <$> (ConvertTag.taggedEntityWith (env ^. Anchors.codeAnchors) Nothing defVar & join) <*> pure defVar <*> (ExprLoad.def defI & lift <&> Definition.defPayload .~ defI >>= convertDefBody env) ?? (nextOutdatedDef (env ^. Anchors.codeAnchors) defI >>= Lens._Just (jumpToDefinition (env ^. Anchors.codeAnchors))) <&> PaneDefinition where defVar = ExprIRef.globalId defI
683
pane env defI = Definition <$> (ConvertTag.taggedEntityWith (env ^. Anchors.codeAnchors) Nothing defVar & join) <*> pure defVar <*> (ExprLoad.def defI & lift <&> Definition.defPayload .~ defI >>= convertDefBody env) ?? (nextOutdatedDef (env ^. Anchors.codeAnchors) defI >>= Lens._Just (jumpToDefinition (env ^. Anchors.codeAnchors))) <&> PaneDefinition where defVar = ExprIRef.globalId defI
434
false
true
13
15
137
282
138
144
null
null
ezyang/ghc
utils/genapply/Main.hs
bsd-3-clause
genMkPAP :: RegStatus -- Register status -> String -- Macro -> String -- Jump target -> [Reg] -- Registers that are definitely live -> String -- Ticker -> String -- Disamb -> Bool -- Don't load argument registers before jump if True -> Bool -- Arguments already in registers if True -> Bool -- Is a PAP if True -> [ArgRep] -- Arguments -> Int -- Size of all arguments -> Doc -- info label -> Bool -- Is a function -> (Doc, StackUsage) genMkPAP regstatus macro jump live ticker disamb no_load_regs -- don't load argument regs before jumping args_in_regs -- arguments are already in regs is_pap args all_args_size fun_info_label is_fun_case = (doc, stack_usage) where doc = vcat smaller_arity_doc $$ exact_arity_case $$ larger_arity_doc stack_usage = maxStack (larger_arity_stack : smaller_arity_stack) n_args = length args -- offset of arguments on the stack at slow apply calls. stk_args_slow_offset = 1 stk_args_offset | args_in_regs = 0 | otherwise = stk_args_slow_offset -- The SMALLER ARITY cases: -- if (arity == 1) { -- Sp[0] = Sp[1]; -- Sp[1] = (W_)&stg_ap_1_info; -- JMP_(GET_ENTRY(R1.cl)); (smaller_arity_doc, smaller_arity_stack) = unzip [ smaller_arity i | i <- [1..n_args-1] ] smaller_arity arity = (doc, stack_usage) where (save_regs, stack_usage) | overflow_regs = save_extra_regs | otherwise = shuffle_extra_args doc = text "if (arity == " <> int arity <> text ") {" $$ nest 4 (vcat [ -- text "TICK_SLOW_CALL_" <> text ticker <> text "_TOO_MANY();", -- load up regs for the call, if necessary load_regs, -- If we have more args in registers than are required -- for the call, then we must save some on the stack, -- and set up the stack for the follow-up call. -- If the extra arguments are on the stack, then we must -- instead shuffle them down to make room for the info -- table for the follow-on call. save_regs, -- for a PAP, we have to arrange that the stack contains a -- return address in the event that stg_PAP_entry fails its -- heap check. See stg_PAP_entry in Apply.cmm for details. if is_pap then text "R2 = " <> mkApplyInfoName this_call_args <> semi else empty, if is_fun_case then mb_tag_node arity else empty, if overflow_regs then mkJumpSaveCCCS regstatus (text jump) live (take arity args) <> semi else mkJump regstatus (text jump) live (if no_load_regs then [] else args) <> semi ]) $$ text "}" -- offsets in case we need to save regs: (reg_locs, _, _) = assignRegs regstatus stk_args_offset args -- register assignment for *this function call* (reg_locs', reg_call_leftovers, reg_call_sp_stk_args) = assignRegs regstatus stk_args_offset (take arity args) load_regs | no_load_regs || args_in_regs = empty | otherwise = loadRegOffs reg_locs' (this_call_args, rest_args) = splitAt arity args -- the offset of the stack args from initial Sp sp_stk_args | args_in_regs = stk_args_offset | no_load_regs = stk_args_offset | otherwise = reg_call_sp_stk_args -- the stack args themselves this_call_stack_args | args_in_regs = reg_call_leftovers -- sp offsets are wrong | no_load_regs = this_call_args | otherwise = reg_call_leftovers stack_args_size = sum (map argSize this_call_stack_args) overflow_regs = args_in_regs && length reg_locs > length reg_locs' save_extra_regs = (doc, (size,size)) where -- we have extra arguments in registers to save extra_reg_locs = drop (length reg_locs') (reverse reg_locs) adj_reg_locs = [ (reg, off - adj + 1) | (reg,off) <- extra_reg_locs ] adj = case extra_reg_locs of (reg, fst_off):_ -> fst_off size = snd (last adj_reg_locs) + 1 doc = text "Sp_adj(" <> int (-size) <> text ");" $$ saveRegOffs adj_reg_locs $$ loadSpWordOff "W_" 0 <> text " = " <> mkApplyInfoName rest_args <> semi shuffle_extra_args = (doc, (shuffle_prof_stack, shuffle_norm_stack)) where doc = vcat [ text "#if defined(PROFILING)", shuffle_prof_doc, text "#else", shuffle_norm_doc, text "#endif"] (shuffle_prof_doc, shuffle_prof_stack) = shuffle True (shuffle_norm_doc, shuffle_norm_stack) = shuffle False -- Sadly here we have to insert an stg_restore_cccs frame -- just underneath the stg_ap_*_info frame if we're -- profiling; see Note [jump_SAVE_CCCS] shuffle prof = (doc, -sp_adj) where sp_adj = sp_stk_args - 1 - offset offset = if prof then 2 else 0 doc = vcat (map (shuffle_down (offset+1)) [sp_stk_args .. sp_stk_args+stack_args_size-1]) $$ (if prof then loadSpWordOff "W_" (sp_stk_args+stack_args_size-3) <> text " = stg_restore_cccs_info;" $$ loadSpWordOff "W_" (sp_stk_args+stack_args_size-2) <> text " = CCCS;" else empty) $$ loadSpWordOff "W_" (sp_stk_args+stack_args_size-1) <> text " = " <> mkApplyInfoName rest_args <> semi $$ text "Sp_adj(" <> int sp_adj <> text ");" shuffle_down j i = loadSpWordOff "W_" (i-j) <> text " = " <> loadSpWordOff "W_" i <> semi -- The EXACT ARITY case -- -- if (arity == 1) { -- Sp++; -- JMP_(GET_ENTRY(R1.cl)); exact_arity_case = text "if (arity == " <> int n_args <> text ") {" $$ let (reg_doc, sp') | no_load_regs || args_in_regs = (empty, stk_args_offset) | otherwise = loadRegArgs regstatus stk_args_offset args in nest 4 (vcat [ -- text "TICK_SLOW_CALL_" <> text ticker <> text "_CORRECT();", reg_doc, text "Sp_adj(" <> int sp' <> text ");", if is_pap then text "R2 = " <> fun_info_label <> semi else empty, if is_fun_case then mb_tag_node n_args else empty, mkJump regstatus (text jump) live (if no_load_regs then [] else args) <> semi ]) -- The LARGER ARITY cases: -- -- } else /* arity > 1 */ { -- BUILD_PAP(1,0,(W_)&stg_ap_v_info); -- } (larger_arity_doc, larger_arity_stack) = (doc, stack) where -- offsets in case we need to save regs: (reg_locs, leftovers, sp_offset) = assignRegs regstatus stk_args_slow_offset args -- BUILD_PAP assumes args start at offset 1 stack | args_in_regs = (sp_offset, sp_offset) | otherwise = (0,0) doc = text "} else {" $$ let save_regs | args_in_regs = text "Sp_adj(" <> int (-sp_offset) <> text ");" $$ saveRegOffs reg_locs | otherwise = empty in nest 4 (vcat [ -- text "TICK_SLOW_CALL_" <> text ticker <> text "_TOO_FEW();", save_regs, -- Before building the PAP, tag the function closure pointer if is_fun_case then vcat [ text "if (arity < " <> int tAG_BITS_MAX <> text ") {", text " R1 = R1 + arity" <> semi, text "}" ] else empty , text macro <> char '(' <> int n_args <> comma <> int all_args_size <> text "," <> fun_info_label <> text "," <> text disamb <> text ");" ]) $$ char '}' -- Note [jump_SAVE_CCCS] -- when profiling, if we have some extra arguments to apply that we -- save to the stack, we must also save the current cost centre stack -- and restore it when applying the extra arguments. This is all -- handled by the macro jump_SAVE_CCCS(target), defined in -- rts/AutoApply.h. -- -- At the jump, the stack will look like this: -- -- ... extra args ... -- stg_ap_pp_info -- CCCS -- stg_restore_cccs_info -- -------------------------------------- -- Examine tag bits of function pointer and enter it -- directly if needed. -- TODO: remove the redundant case in the original code.
9,562
genMkPAP :: RegStatus -- Register status -> String -- Macro -> String -- Jump target -> [Reg] -- Registers that are definitely live -> String -- Ticker -> String -- Disamb -> Bool -- Don't load argument registers before jump if True -> Bool -- Arguments already in registers if True -> Bool -- Is a PAP if True -> [ArgRep] -- Arguments -> Int -- Size of all arguments -> Doc -- info label -> Bool -- Is a function -> (Doc, StackUsage) genMkPAP regstatus macro jump live ticker disamb no_load_regs -- don't load argument regs before jumping args_in_regs -- arguments are already in regs is_pap args all_args_size fun_info_label is_fun_case = (doc, stack_usage) where doc = vcat smaller_arity_doc $$ exact_arity_case $$ larger_arity_doc stack_usage = maxStack (larger_arity_stack : smaller_arity_stack) n_args = length args -- offset of arguments on the stack at slow apply calls. stk_args_slow_offset = 1 stk_args_offset | args_in_regs = 0 | otherwise = stk_args_slow_offset -- The SMALLER ARITY cases: -- if (arity == 1) { -- Sp[0] = Sp[1]; -- Sp[1] = (W_)&stg_ap_1_info; -- JMP_(GET_ENTRY(R1.cl)); (smaller_arity_doc, smaller_arity_stack) = unzip [ smaller_arity i | i <- [1..n_args-1] ] smaller_arity arity = (doc, stack_usage) where (save_regs, stack_usage) | overflow_regs = save_extra_regs | otherwise = shuffle_extra_args doc = text "if (arity == " <> int arity <> text ") {" $$ nest 4 (vcat [ -- text "TICK_SLOW_CALL_" <> text ticker <> text "_TOO_MANY();", -- load up regs for the call, if necessary load_regs, -- If we have more args in registers than are required -- for the call, then we must save some on the stack, -- and set up the stack for the follow-up call. -- If the extra arguments are on the stack, then we must -- instead shuffle them down to make room for the info -- table for the follow-on call. save_regs, -- for a PAP, we have to arrange that the stack contains a -- return address in the event that stg_PAP_entry fails its -- heap check. See stg_PAP_entry in Apply.cmm for details. if is_pap then text "R2 = " <> mkApplyInfoName this_call_args <> semi else empty, if is_fun_case then mb_tag_node arity else empty, if overflow_regs then mkJumpSaveCCCS regstatus (text jump) live (take arity args) <> semi else mkJump regstatus (text jump) live (if no_load_regs then [] else args) <> semi ]) $$ text "}" -- offsets in case we need to save regs: (reg_locs, _, _) = assignRegs regstatus stk_args_offset args -- register assignment for *this function call* (reg_locs', reg_call_leftovers, reg_call_sp_stk_args) = assignRegs regstatus stk_args_offset (take arity args) load_regs | no_load_regs || args_in_regs = empty | otherwise = loadRegOffs reg_locs' (this_call_args, rest_args) = splitAt arity args -- the offset of the stack args from initial Sp sp_stk_args | args_in_regs = stk_args_offset | no_load_regs = stk_args_offset | otherwise = reg_call_sp_stk_args -- the stack args themselves this_call_stack_args | args_in_regs = reg_call_leftovers -- sp offsets are wrong | no_load_regs = this_call_args | otherwise = reg_call_leftovers stack_args_size = sum (map argSize this_call_stack_args) overflow_regs = args_in_regs && length reg_locs > length reg_locs' save_extra_regs = (doc, (size,size)) where -- we have extra arguments in registers to save extra_reg_locs = drop (length reg_locs') (reverse reg_locs) adj_reg_locs = [ (reg, off - adj + 1) | (reg,off) <- extra_reg_locs ] adj = case extra_reg_locs of (reg, fst_off):_ -> fst_off size = snd (last adj_reg_locs) + 1 doc = text "Sp_adj(" <> int (-size) <> text ");" $$ saveRegOffs adj_reg_locs $$ loadSpWordOff "W_" 0 <> text " = " <> mkApplyInfoName rest_args <> semi shuffle_extra_args = (doc, (shuffle_prof_stack, shuffle_norm_stack)) where doc = vcat [ text "#if defined(PROFILING)", shuffle_prof_doc, text "#else", shuffle_norm_doc, text "#endif"] (shuffle_prof_doc, shuffle_prof_stack) = shuffle True (shuffle_norm_doc, shuffle_norm_stack) = shuffle False -- Sadly here we have to insert an stg_restore_cccs frame -- just underneath the stg_ap_*_info frame if we're -- profiling; see Note [jump_SAVE_CCCS] shuffle prof = (doc, -sp_adj) where sp_adj = sp_stk_args - 1 - offset offset = if prof then 2 else 0 doc = vcat (map (shuffle_down (offset+1)) [sp_stk_args .. sp_stk_args+stack_args_size-1]) $$ (if prof then loadSpWordOff "W_" (sp_stk_args+stack_args_size-3) <> text " = stg_restore_cccs_info;" $$ loadSpWordOff "W_" (sp_stk_args+stack_args_size-2) <> text " = CCCS;" else empty) $$ loadSpWordOff "W_" (sp_stk_args+stack_args_size-1) <> text " = " <> mkApplyInfoName rest_args <> semi $$ text "Sp_adj(" <> int sp_adj <> text ");" shuffle_down j i = loadSpWordOff "W_" (i-j) <> text " = " <> loadSpWordOff "W_" i <> semi -- The EXACT ARITY case -- -- if (arity == 1) { -- Sp++; -- JMP_(GET_ENTRY(R1.cl)); exact_arity_case = text "if (arity == " <> int n_args <> text ") {" $$ let (reg_doc, sp') | no_load_regs || args_in_regs = (empty, stk_args_offset) | otherwise = loadRegArgs regstatus stk_args_offset args in nest 4 (vcat [ -- text "TICK_SLOW_CALL_" <> text ticker <> text "_CORRECT();", reg_doc, text "Sp_adj(" <> int sp' <> text ");", if is_pap then text "R2 = " <> fun_info_label <> semi else empty, if is_fun_case then mb_tag_node n_args else empty, mkJump regstatus (text jump) live (if no_load_regs then [] else args) <> semi ]) -- The LARGER ARITY cases: -- -- } else /* arity > 1 */ { -- BUILD_PAP(1,0,(W_)&stg_ap_v_info); -- } (larger_arity_doc, larger_arity_stack) = (doc, stack) where -- offsets in case we need to save regs: (reg_locs, leftovers, sp_offset) = assignRegs regstatus stk_args_slow_offset args -- BUILD_PAP assumes args start at offset 1 stack | args_in_regs = (sp_offset, sp_offset) | otherwise = (0,0) doc = text "} else {" $$ let save_regs | args_in_regs = text "Sp_adj(" <> int (-sp_offset) <> text ");" $$ saveRegOffs reg_locs | otherwise = empty in nest 4 (vcat [ -- text "TICK_SLOW_CALL_" <> text ticker <> text "_TOO_FEW();", save_regs, -- Before building the PAP, tag the function closure pointer if is_fun_case then vcat [ text "if (arity < " <> int tAG_BITS_MAX <> text ") {", text " R1 = R1 + arity" <> semi, text "}" ] else empty , text macro <> char '(' <> int n_args <> comma <> int all_args_size <> text "," <> fun_info_label <> text "," <> text disamb <> text ");" ]) $$ char '}' -- Note [jump_SAVE_CCCS] -- when profiling, if we have some extra arguments to apply that we -- save to the stack, we must also save the current cost centre stack -- and restore it when applying the extra arguments. This is all -- handled by the macro jump_SAVE_CCCS(target), defined in -- rts/AutoApply.h. -- -- At the jump, the stack will look like this: -- -- ... extra args ... -- stg_ap_pp_info -- CCCS -- stg_restore_cccs_info -- -------------------------------------- -- Examine tag bits of function pointer and enter it -- directly if needed. -- TODO: remove the redundant case in the original code.
9,562
genMkPAP regstatus macro jump live ticker disamb no_load_regs -- don't load argument regs before jumping args_in_regs -- arguments are already in regs is_pap args all_args_size fun_info_label is_fun_case = (doc, stack_usage) where doc = vcat smaller_arity_doc $$ exact_arity_case $$ larger_arity_doc stack_usage = maxStack (larger_arity_stack : smaller_arity_stack) n_args = length args -- offset of arguments on the stack at slow apply calls. stk_args_slow_offset = 1 stk_args_offset | args_in_regs = 0 | otherwise = stk_args_slow_offset -- The SMALLER ARITY cases: -- if (arity == 1) { -- Sp[0] = Sp[1]; -- Sp[1] = (W_)&stg_ap_1_info; -- JMP_(GET_ENTRY(R1.cl)); (smaller_arity_doc, smaller_arity_stack) = unzip [ smaller_arity i | i <- [1..n_args-1] ] smaller_arity arity = (doc, stack_usage) where (save_regs, stack_usage) | overflow_regs = save_extra_regs | otherwise = shuffle_extra_args doc = text "if (arity == " <> int arity <> text ") {" $$ nest 4 (vcat [ -- text "TICK_SLOW_CALL_" <> text ticker <> text "_TOO_MANY();", -- load up regs for the call, if necessary load_regs, -- If we have more args in registers than are required -- for the call, then we must save some on the stack, -- and set up the stack for the follow-up call. -- If the extra arguments are on the stack, then we must -- instead shuffle them down to make room for the info -- table for the follow-on call. save_regs, -- for a PAP, we have to arrange that the stack contains a -- return address in the event that stg_PAP_entry fails its -- heap check. See stg_PAP_entry in Apply.cmm for details. if is_pap then text "R2 = " <> mkApplyInfoName this_call_args <> semi else empty, if is_fun_case then mb_tag_node arity else empty, if overflow_regs then mkJumpSaveCCCS regstatus (text jump) live (take arity args) <> semi else mkJump regstatus (text jump) live (if no_load_regs then [] else args) <> semi ]) $$ text "}" -- offsets in case we need to save regs: (reg_locs, _, _) = assignRegs regstatus stk_args_offset args -- register assignment for *this function call* (reg_locs', reg_call_leftovers, reg_call_sp_stk_args) = assignRegs regstatus stk_args_offset (take arity args) load_regs | no_load_regs || args_in_regs = empty | otherwise = loadRegOffs reg_locs' (this_call_args, rest_args) = splitAt arity args -- the offset of the stack args from initial Sp sp_stk_args | args_in_regs = stk_args_offset | no_load_regs = stk_args_offset | otherwise = reg_call_sp_stk_args -- the stack args themselves this_call_stack_args | args_in_regs = reg_call_leftovers -- sp offsets are wrong | no_load_regs = this_call_args | otherwise = reg_call_leftovers stack_args_size = sum (map argSize this_call_stack_args) overflow_regs = args_in_regs && length reg_locs > length reg_locs' save_extra_regs = (doc, (size,size)) where -- we have extra arguments in registers to save extra_reg_locs = drop (length reg_locs') (reverse reg_locs) adj_reg_locs = [ (reg, off - adj + 1) | (reg,off) <- extra_reg_locs ] adj = case extra_reg_locs of (reg, fst_off):_ -> fst_off size = snd (last adj_reg_locs) + 1 doc = text "Sp_adj(" <> int (-size) <> text ");" $$ saveRegOffs adj_reg_locs $$ loadSpWordOff "W_" 0 <> text " = " <> mkApplyInfoName rest_args <> semi shuffle_extra_args = (doc, (shuffle_prof_stack, shuffle_norm_stack)) where doc = vcat [ text "#if defined(PROFILING)", shuffle_prof_doc, text "#else", shuffle_norm_doc, text "#endif"] (shuffle_prof_doc, shuffle_prof_stack) = shuffle True (shuffle_norm_doc, shuffle_norm_stack) = shuffle False -- Sadly here we have to insert an stg_restore_cccs frame -- just underneath the stg_ap_*_info frame if we're -- profiling; see Note [jump_SAVE_CCCS] shuffle prof = (doc, -sp_adj) where sp_adj = sp_stk_args - 1 - offset offset = if prof then 2 else 0 doc = vcat (map (shuffle_down (offset+1)) [sp_stk_args .. sp_stk_args+stack_args_size-1]) $$ (if prof then loadSpWordOff "W_" (sp_stk_args+stack_args_size-3) <> text " = stg_restore_cccs_info;" $$ loadSpWordOff "W_" (sp_stk_args+stack_args_size-2) <> text " = CCCS;" else empty) $$ loadSpWordOff "W_" (sp_stk_args+stack_args_size-1) <> text " = " <> mkApplyInfoName rest_args <> semi $$ text "Sp_adj(" <> int sp_adj <> text ");" shuffle_down j i = loadSpWordOff "W_" (i-j) <> text " = " <> loadSpWordOff "W_" i <> semi -- The EXACT ARITY case -- -- if (arity == 1) { -- Sp++; -- JMP_(GET_ENTRY(R1.cl)); exact_arity_case = text "if (arity == " <> int n_args <> text ") {" $$ let (reg_doc, sp') | no_load_regs || args_in_regs = (empty, stk_args_offset) | otherwise = loadRegArgs regstatus stk_args_offset args in nest 4 (vcat [ -- text "TICK_SLOW_CALL_" <> text ticker <> text "_CORRECT();", reg_doc, text "Sp_adj(" <> int sp' <> text ");", if is_pap then text "R2 = " <> fun_info_label <> semi else empty, if is_fun_case then mb_tag_node n_args else empty, mkJump regstatus (text jump) live (if no_load_regs then [] else args) <> semi ]) -- The LARGER ARITY cases: -- -- } else /* arity > 1 */ { -- BUILD_PAP(1,0,(W_)&stg_ap_v_info); -- } (larger_arity_doc, larger_arity_stack) = (doc, stack) where -- offsets in case we need to save regs: (reg_locs, leftovers, sp_offset) = assignRegs regstatus stk_args_slow_offset args -- BUILD_PAP assumes args start at offset 1 stack | args_in_regs = (sp_offset, sp_offset) | otherwise = (0,0) doc = text "} else {" $$ let save_regs | args_in_regs = text "Sp_adj(" <> int (-sp_offset) <> text ");" $$ saveRegOffs reg_locs | otherwise = empty in nest 4 (vcat [ -- text "TICK_SLOW_CALL_" <> text ticker <> text "_TOO_FEW();", save_regs, -- Before building the PAP, tag the function closure pointer if is_fun_case then vcat [ text "if (arity < " <> int tAG_BITS_MAX <> text ") {", text " R1 = R1 + arity" <> semi, text "}" ] else empty , text macro <> char '(' <> int n_args <> comma <> int all_args_size <> text "," <> fun_info_label <> text "," <> text disamb <> text ");" ]) $$ char '}' -- Note [jump_SAVE_CCCS] -- when profiling, if we have some extra arguments to apply that we -- save to the stack, we must also save the current cost centre stack -- and restore it when applying the extra arguments. This is all -- handled by the macro jump_SAVE_CCCS(target), defined in -- rts/AutoApply.h. -- -- At the jump, the stack will look like this: -- -- ... extra args ... -- stg_ap_pp_info -- CCCS -- stg_restore_cccs_info -- -------------------------------------- -- Examine tag bits of function pointer and enter it -- directly if needed. -- TODO: remove the redundant case in the original code.
8,961
false
true
29
20
3,744
1,745
883
862
null
null
meiersi-11ce/stack
src/main/Main.hs
bsd-3-clause
uninstallCmd :: [String] -> GlobalOpts -> IO () uninstallCmd _ go = withConfigAndLock go $ do $logError "stack does not manage installations in global locations" $logError "The only global mutation stack performs is executable copying" $logError "For the default executable destination, please run 'stack path --local-bin-path'" -- | Unpack packages to the filesystem
380
uninstallCmd :: [String] -> GlobalOpts -> IO () uninstallCmd _ go = withConfigAndLock go $ do $logError "stack does not manage installations in global locations" $logError "The only global mutation stack performs is executable copying" $logError "For the default executable destination, please run 'stack path --local-bin-path'" -- | Unpack packages to the filesystem
380
uninstallCmd _ go = withConfigAndLock go $ do $logError "stack does not manage installations in global locations" $logError "The only global mutation stack performs is executable copying" $logError "For the default executable destination, please run 'stack path --local-bin-path'" -- | Unpack packages to the filesystem
332
false
true
0
9
65
61
26
35
null
null
osa1/sequent-core
src/Language/SequentCore/Syntax.hs
bsd-3-clause
isTrivialKont _ = False
42
isTrivialKont _ = False
42
isTrivialKont _ = False
42
false
false
0
4
22
10
4
6
null
null
tonyfloatersu/solution-haskell-craft-of-FP
Chapter4.hs
mit
lose Rock = Scissors
24
lose Rock = Scissors
24
lose Rock = Scissors
24
false
false
0
4
7
10
4
6
null
null
GaloisInc/smaccmpilot-gcs-gateway
SMACCMPilot/GCS/Gateway/Queue.hs
bsd-3-clause
queuePop :: QueueInput a -> IO a queuePop q = atomically (readTQueue (unQueueInput q))
86
queuePop :: QueueInput a -> IO a queuePop q = atomically (readTQueue (unQueueInput q))
86
queuePop q = atomically (readTQueue (unQueueInput q))
53
false
true
0
9
13
39
18
21
null
null
emptylambda/BLT
src/Boogie/PrettyAST.hs
gpl-3.0
varDeclDoc vars = text "var" <+> commaSep (map idTypeWhereDoc vars) <> semi
81
varDeclDoc vars = text "var" <+> commaSep (map idTypeWhereDoc vars) <> semi
81
varDeclDoc vars = text "var" <+> commaSep (map idTypeWhereDoc vars) <> semi
81
false
false
0
9
17
31
14
17
null
null
a143753/AOJ
0029.hs
apache-2.0
max :: [(Int,String)] -> (Int,String) max [] = (0,"")
53
max :: [(Int,String)] -> (Int,String) max [] = (0,"")
53
max [] = (0,"")
15
false
true
0
7
8
45
25
20
null
null
vdweegen/UvA-Software_Testing
Lab5/Final/Lecture5NRC.hs
gpl-3.0
subgridInjectiveNRC :: Sudoku -> (Row,Column) -> Bool subgridInjectiveNRC s (r,c) = injective vs where vs = filter (/= 0) (subGridNRC s (r,c)) -- | Check for same block with and without NRC
193
subgridInjectiveNRC :: Sudoku -> (Row,Column) -> Bool subgridInjectiveNRC s (r,c) = injective vs where vs = filter (/= 0) (subGridNRC s (r,c)) -- | Check for same block with and without NRC
193
subgridInjectiveNRC s (r,c) = injective vs where vs = filter (/= 0) (subGridNRC s (r,c)) -- | Check for same block with and without NRC
139
false
true
0
10
35
75
40
35
null
null
y-kamiya/parallel-concurrent-haskell
src/Stm/TList.hs
gpl-2.0
readMList :: MList a -> IO a readMList m@(MList v) = do list <- readMVar' v case list of [] -> readMList m (x:xs) -> putMVar v xs >> return x
153
readMList :: MList a -> IO a readMList m@(MList v) = do list <- readMVar' v case list of [] -> readMList m (x:xs) -> putMVar v xs >> return x
153
readMList m@(MList v) = do list <- readMVar' v case list of [] -> readMList m (x:xs) -> putMVar v xs >> return x
124
false
true
0
11
42
86
40
46
null
null
lally/xmonad-reenberg
XMonad/StackSet.hs
bsd-3-clause
shiftMaster :: StackSet i l a s sd -> StackSet i l a s sd shiftMaster = modify' $ \c -> case c of Stack _ [] _ -> c -- already master. Stack t ls rs -> Stack t [] (reverse ls ++ rs) -- | /O(s)/. Set focus to the master window.
239
shiftMaster :: StackSet i l a s sd -> StackSet i l a s sd shiftMaster = modify' $ \c -> case c of Stack _ [] _ -> c -- already master. Stack t ls rs -> Stack t [] (reverse ls ++ rs) -- | /O(s)/. Set focus to the master window.
239
shiftMaster = modify' $ \c -> case c of Stack _ [] _ -> c -- already master. Stack t ls rs -> Stack t [] (reverse ls ++ rs) -- | /O(s)/. Set focus to the master window.
181
false
true
4
7
66
96
49
47
null
null
SEEK-Org/evaporate
src/FileSystem.hs
mit
sourceFileOrDirectory :: MonadResource m => Bool -> FilePath -> Producer m FilePath sourceFileOrDirectory followSymlinks path = do fileType <- checkPath path case fileType of File f -> yield f Directory d -> sourceDirectoryDeep followSymlinks d
261
sourceFileOrDirectory :: MonadResource m => Bool -> FilePath -> Producer m FilePath sourceFileOrDirectory followSymlinks path = do fileType <- checkPath path case fileType of File f -> yield f Directory d -> sourceDirectoryDeep followSymlinks d
261
sourceFileOrDirectory followSymlinks path = do fileType <- checkPath path case fileType of File f -> yield f Directory d -> sourceDirectoryDeep followSymlinks d
177
false
true
0
10
51
79
35
44
null
null
jprider63/aeson-ios-0.8.0.2
dist/arm/build/autogen/Paths_aeson.hs
bsd-3-clause
getLibDir = catchIO (getEnv "aeson_libdir") (\_ -> return libdir)
65
getLibDir = catchIO (getEnv "aeson_libdir") (\_ -> return libdir)
65
getLibDir = catchIO (getEnv "aeson_libdir") (\_ -> return libdir)
65
false
false
1
8
8
33
14
19
null
null
eigengrau/haskell-ghci-pprint
src/GHC/GHCi/PPrint.hs
gpl-3.0
myPrint ∷ Show α ⇒ α → IO () myPrint = putStrLn ∘ myColorize ∘ myShow
69
myPrint ∷ Show α ⇒ α → IO () myPrint = putStrLn ∘ myColorize ∘ myShow
69
myPrint = putStrLn ∘ myColorize ∘ myShow
40
false
true
0
8
15
35
17
18
null
null
ezyang/ghc
compiler/prelude/THNames.hs
bsd-3-clause
-- type VarBangType = ... varBangTypeName :: Name varBangTypeName = libFun (fsLit "varBangType") varBangTKey
108
varBangTypeName :: Name varBangTypeName = libFun (fsLit "varBangType") varBangTKey
82
varBangTypeName = libFun (fsLit "varBangType") varBangTKey
58
true
true
0
7
13
23
12
11
null
null
dag/path
src/System/Path/Internal.hs
bsd-3-clause
-- | A directory. dir :: Name -> Directory </> Directory dir = link . DirectoryName
83
dir :: Name -> Directory </> Directory dir = link . DirectoryName
65
dir = link . DirectoryName
26
true
true
1
8
15
32
14
18
null
null
tjakway/ghcjvm
testsuite/tests/ado/ado001.hs
bsd-3-clause
test7 :: M () test7 = do x1 <- a x2 <- b x3 <- const c x1 x4 <- const d x2 return () `const` (x3,x4) -- a; (b | c | d) -- -- alternative (but less good): -- ((a;b) | c); d
182
test7 :: M () test7 = do x1 <- a x2 <- b x3 <- const c x1 x4 <- const d x2 return () `const` (x3,x4) -- a; (b | c | d) -- -- alternative (but less good): -- ((a;b) | c); d
182
test7 = do x1 <- a x2 <- b x3 <- const c x1 x4 <- const d x2 return () `const` (x3,x4) -- a; (b | c | d) -- -- alternative (but less good): -- ((a;b) | c); d
168
false
true
0
9
55
84
40
44
null
null
frosch03/arrowVHDL
src/System/ArrowVHDL/Circuit/Arrow/Helpers.hs
cc0-1.0
-- Weitere Hilfsfunktionen werden notwendig, um schon bestehende \hsSource{Grid}-Arrows mit Schaltkreis Beschreibungen anzureichern. insert :: b -> (a, b) -> (a, b) insert sg ~(x, _) = (x, sg)
195
insert :: b -> (a, b) -> (a, b) insert sg ~(x, _) = (x, sg)
59
insert sg ~(x, _) = (x, sg)
27
true
true
0
7
31
50
29
21
null
null
dysinger/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
mpl-2.0
etstsS3Bucket :: Lens' ExportToS3TaskSpecification (Maybe Text) etstsS3Bucket = lens _etstsS3Bucket (\s a -> s { _etstsS3Bucket = a })
134
etstsS3Bucket :: Lens' ExportToS3TaskSpecification (Maybe Text) etstsS3Bucket = lens _etstsS3Bucket (\s a -> s { _etstsS3Bucket = a })
134
etstsS3Bucket = lens _etstsS3Bucket (\s a -> s { _etstsS3Bucket = a })
70
false
true
0
9
18
45
24
21
null
null
rahulmutt/ghcvm
libraries/eta-meta/Language/Eta/Meta/Syntax.hs
bsd-3-clause
occString :: OccName -> String occString (OccName occ) = occ
60
occString :: OccName -> String occString (OccName occ) = occ
60
occString (OccName occ) = occ
29
false
true
0
7
9
24
12
12
null
null
GaloisInc/galua
galua-jit/src/Galua/Micro/Type/Value.hs
mit
-- | A call-site "outside" the program. It is used for the initial -- call in the analysis. initialCaller :: CallsiteId initialCaller = CallsiteId (QualifiedBlockName noFun EntryBlock) 0
187
initialCaller :: CallsiteId initialCaller = CallsiteId (QualifiedBlockName noFun EntryBlock) 0
94
initialCaller = CallsiteId (QualifiedBlockName noFun EntryBlock) 0
66
true
true
0
7
28
32
15
17
null
null
TomMD/crypto-api-tests
Test/Crypto.hs
bsd-3-clause
l2b = B.concat . L.toChunks
27
l2b = B.concat . L.toChunks
27
l2b = B.concat . L.toChunks
27
false
false
2
6
4
19
7
12
null
null
ganeti-github-testing/ganeti-test-1
src/Ganeti/Constants.hs
bsd-2-clause
nvSshSetup :: String nvSshSetup = "ssh-setup"
45
nvSshSetup :: String nvSshSetup = "ssh-setup"
45
nvSshSetup = "ssh-setup"
24
false
true
0
4
5
11
6
5
null
null
kojiromike/Idris-dev
src/IRTS/Bytecode.hs
bsd-3-clause
bc :: Reg -> SExp -> Bool -> -- returning [BC] bc reg (SV (Glob n)) r = bc reg (SApp False n []) r
104
bc :: Reg -> SExp -> Bool -> -- returning [BC] bc reg (SV (Glob n)) r = bc reg (SApp False n []) r
104
bc reg (SV (Glob n)) r = bc reg (SApp False n []) r
51
false
true
0
9
30
65
33
32
null
null
jgm/haddock
src/Haddock/Utils.hs
bsd-2-clause
moduleHtmlFile' :: ModuleName -> FilePath moduleHtmlFile' mdl = case Map.lookup mdl html_xrefs' of Nothing -> baseName mdl ++ ".html" Just fp0 -> HtmlPath.joinPath [fp0, baseName mdl ++ ".html"]
205
moduleHtmlFile' :: ModuleName -> FilePath moduleHtmlFile' mdl = case Map.lookup mdl html_xrefs' of Nothing -> baseName mdl ++ ".html" Just fp0 -> HtmlPath.joinPath [fp0, baseName mdl ++ ".html"]
205
moduleHtmlFile' mdl = case Map.lookup mdl html_xrefs' of Nothing -> baseName mdl ++ ".html" Just fp0 -> HtmlPath.joinPath [fp0, baseName mdl ++ ".html"]
163
false
true
3
7
38
64
32
32
null
null
ElastiLotem/deeplink
test/test-order.hs
gpl-2.0
prunes :: [Int] prunes = [8, 10]
32
prunes :: [Int] prunes = [8, 10]
32
prunes = [8, 10]
16
false
true
0
7
6
27
13
14
null
null
AndrewWUw/cs9181
Data/Array/Accelerate/C/Exp.hs
bsd-3-clause
fun2ToC _aenv _ = error "D.A.A.C.Exp.fun2ToC: unreachable"
58
fun2ToC _aenv _ = error "D.A.A.C.Exp.fun2ToC: unreachable"
58
fun2ToC _aenv _ = error "D.A.A.C.Exp.fun2ToC: unreachable"
58
false
false
0
5
6
15
6
9
null
null
apyrgio/ganeti
src/Ganeti/Hs2Py/OpDoc.hs
bsd-2-clause
opInstanceStartup :: String opInstanceStartup = "Startup an instance."
72
opInstanceStartup :: String opInstanceStartup = "Startup an instance."
72
opInstanceStartup = "Startup an instance."
44
false
true
0
4
9
11
6
5
null
null
brendanhay/gogol
gogol-monitoring/gen/Network/Google/Monitoring/Types.hs
mpl-2.0
-- | Publish metric data to your Google Cloud projects monitoringWriteScope :: Proxy '["https://www.googleapis.com/auth/monitoring.write"] monitoringWriteScope = Proxy
167
monitoringWriteScope :: Proxy '["https://www.googleapis.com/auth/monitoring.write"] monitoringWriteScope = Proxy
112
monitoringWriteScope = Proxy
28
true
true
0
7
16
20
11
9
null
null
brendanhay/gogol
gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Flows/Validate.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). plafvUploadProtocol :: Lens' ProjectsLocationsAgentsFlowsValidate (Maybe Text) plafvUploadProtocol = lens _plafvUploadProtocol (\ s a -> s{_plafvUploadProtocol = a})
235
plafvUploadProtocol :: Lens' ProjectsLocationsAgentsFlowsValidate (Maybe Text) plafvUploadProtocol = lens _plafvUploadProtocol (\ s a -> s{_plafvUploadProtocol = a})
173
plafvUploadProtocol = lens _plafvUploadProtocol (\ s a -> s{_plafvUploadProtocol = a})
94
true
true
0
8
33
49
25
24
null
null
Marthog/ld35
src/Lib.hs
gpl-3.0
downButtons = [SpecialKey KeyDown]
34
downButtons = [SpecialKey KeyDown]
34
downButtons = [SpecialKey KeyDown]
34
false
false
1
6
3
15
6
9
null
null
thomie/vector
Data/Vector/Primitive.hs
bsd-3-clause
findIndex = G.findIndex
23
findIndex = G.findIndex
23
findIndex = G.findIndex
23
false
false
0
5
2
8
4
4
null
null
madjestic/b1
tests/B1/Data/RangeTest.hs
bsd-3-clause
pairList (x:y:[]) = [(x, y)]
28
pairList (x:y:[]) = [(x, y)]
28
pairList (x:y:[]) = [(x, y)]
28
false
false
0
8
4
32
17
15
null
null
duplode/stack
src/Stack/Options.hs
bsd-3-clause
solverOptsParser :: Parser Bool solverOptsParser = boolFlags False "modify-stack-yaml" "Automatically modify stack.yaml with the solver's recommendations" idm
170
solverOptsParser :: Parser Bool solverOptsParser = boolFlags False "modify-stack-yaml" "Automatically modify stack.yaml with the solver's recommendations" idm
170
solverOptsParser = boolFlags False "modify-stack-yaml" "Automatically modify stack.yaml with the solver's recommendations" idm
138
false
true
0
6
28
32
12
20
null
null
phischu/fragnix
tests/packages/scotty/Data.ByteString.Short.Internal.hs
bsd-3-clause
createFromPtr :: Ptr a -- ^ source data -> Int -- ^ number of bytes to copy -> IO ShortByteString createFromPtr !ptr len = stToIO $ do mba <- newByteArray len copyAddrToByteArray ptr mba 0 len BA# ba# <- unsafeFreezeByteArray mba return (SBS ba# ) ------------------------------------------------------------------------ -- Primop wrappers
403
createFromPtr :: Ptr a -- ^ source data -> Int -- ^ number of bytes to copy -> IO ShortByteString createFromPtr !ptr len = stToIO $ do mba <- newByteArray len copyAddrToByteArray ptr mba 0 len BA# ba# <- unsafeFreezeByteArray mba return (SBS ba# ) ------------------------------------------------------------------------ -- Primop wrappers
403
createFromPtr !ptr len = stToIO $ do mba <- newByteArray len copyAddrToByteArray ptr mba 0 len BA# ba# <- unsafeFreezeByteArray mba return (SBS ba# ) ------------------------------------------------------------------------ -- Primop wrappers
271
false
true
0
10
112
86
39
47
null
null
sebastiaanvisser/jail
src/System/IO/Jail.hs
bsd-3-clause
hShow :: Handle -> IO String hShow = embedHandle "hShow" U.hShow
64
hShow :: Handle -> IO String hShow = embedHandle "hShow" U.hShow
64
hShow = embedHandle "hShow" U.hShow
35
false
true
0
6
10
25
12
13
null
null
gbataille/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
cedilla 't' = "ţ"
17
cedilla 't' = "ţ"
17
cedilla 't' = "ţ"
17
false
false
1
5
3
13
4
9
null
null
buckie/juno
src/Juno/Util/Util.hs
bsd-3-clause
getCmdSigOrInvariantError :: String -> Command -> Signature getCmdSigOrInvariantError where' s@Command{..} = case _cmdProvenance of NewMsg -> error $ where' ++ ": This should be unreachable, somehow an AE got through with a LogEntry that contained an unsigned Command" ++ show s ReceivedMsg{..} -> _digSig _pDig
319
getCmdSigOrInvariantError :: String -> Command -> Signature getCmdSigOrInvariantError where' s@Command{..} = case _cmdProvenance of NewMsg -> error $ where' ++ ": This should be unreachable, somehow an AE got through with a LogEntry that contained an unsigned Command" ++ show s ReceivedMsg{..} -> _digSig _pDig
319
getCmdSigOrInvariantError where' s@Command{..} = case _cmdProvenance of NewMsg -> error $ where' ++ ": This should be unreachable, somehow an AE got through with a LogEntry that contained an unsigned Command" ++ show s ReceivedMsg{..} -> _digSig _pDig
259
false
true
2
8
52
75
36
39
null
null
spechub/Hets
Comorphisms/ExtModal2HasCASL.hs
gpl-2.0
pairDs :: Type -> [GenVarDecl] pairDs = take 2 . tripDs
55
pairDs :: Type -> [GenVarDecl] pairDs = take 2 . tripDs
55
pairDs = take 2 . tripDs
24
false
true
0
6
10
25
13
12
null
null
hansroland/hexif
src/Graphics/Hexif/Convert.hs
bsd-3-clause
stringValue TagGPSImgDirectionRef _ _ strVal _ = directByte strVal
73
stringValue TagGPSImgDirectionRef _ _ strVal _ = directByte strVal
73
stringValue TagGPSImgDirectionRef _ _ strVal _ = directByte strVal
73
false
false
0
5
15
22
9
13
null
null
fmthoma/ghc
compiler/types/Type.hs
bsd-3-clause
classifyPredType :: PredType -> PredTree classifyPredType ev_ty = case splitTyConApp_maybe ev_ty of Just (tc, tys) | tc `hasKey` coercibleTyConKey , let [_, ty1, ty2] = tys -> EqPred ReprEq ty1 ty2 Just (tc, tys) | tc `hasKey` eqTyConKey , let [_, ty1, ty2] = tys -> EqPred NomEq ty1 ty2 -- NB: Coercible is also a class, so this check must come *after* -- the Coercible check Just (tc, tys) | Just clas <- tyConClass_maybe tc -> ClassPred clas tys _ -> IrredPred ev_ty
590
classifyPredType :: PredType -> PredTree classifyPredType ev_ty = case splitTyConApp_maybe ev_ty of Just (tc, tys) | tc `hasKey` coercibleTyConKey , let [_, ty1, ty2] = tys -> EqPred ReprEq ty1 ty2 Just (tc, tys) | tc `hasKey` eqTyConKey , let [_, ty1, ty2] = tys -> EqPred NomEq ty1 ty2 -- NB: Coercible is also a class, so this check must come *after* -- the Coercible check Just (tc, tys) | Just clas <- tyConClass_maybe tc -> ClassPred clas tys _ -> IrredPred ev_ty
590
classifyPredType ev_ty = case splitTyConApp_maybe ev_ty of Just (tc, tys) | tc `hasKey` coercibleTyConKey , let [_, ty1, ty2] = tys -> EqPred ReprEq ty1 ty2 Just (tc, tys) | tc `hasKey` eqTyConKey , let [_, ty1, ty2] = tys -> EqPred NomEq ty1 ty2 -- NB: Coercible is also a class, so this check must come *after* -- the Coercible check Just (tc, tys) | Just clas <- tyConClass_maybe tc -> ClassPred clas tys _ -> IrredPred ev_ty
549
false
true
0
14
204
180
90
90
null
null
k16shikano/wikipepub
QNDA/Counter.hs
mit
kLabel :: String -> SLA CounterState XmlTree XmlTree -> SLA CounterState XmlTree XmlTree seekLabel whose how = deepest ((ifA (hasName whose) (this) (none)) >>> replaceChildren (eelem "entry" += (eelem "label" += choiceA [ hasAttr "id" :-> (txt . idTrim $< getAttrValue "id") , hasAttr "label" :-> (txt . idTrim $< getAttrValue "label") , this :-> (txt . mkLabel $< (getChildren >>> getText)) ]) += (eelem "hhead" += how) += (eelem "hbody" += (txt $< (getChildren >>> getText))))) where mkLabel s = "name"++(show $ hash s)
986
seekLabel :: String -> SLA CounterState XmlTree XmlTree -> SLA CounterState XmlTree XmlTree seekLabel whose how = deepest ((ifA (hasName whose) (this) (none)) >>> replaceChildren (eelem "entry" += (eelem "label" += choiceA [ hasAttr "id" :-> (txt . idTrim $< getAttrValue "id") , hasAttr "label" :-> (txt . idTrim $< getAttrValue "label") , this :-> (txt . mkLabel $< (getChildren >>> getText)) ]) += (eelem "hhead" += how) += (eelem "hbody" += (txt $< (getChildren >>> getText))))) where mkLabel s = "name"++(show $ hash s)
986
seekLabel whose how = deepest ((ifA (hasName whose) (this) (none)) >>> replaceChildren (eelem "entry" += (eelem "label" += choiceA [ hasAttr "id" :-> (txt . idTrim $< getAttrValue "id") , hasAttr "label" :-> (txt . idTrim $< getAttrValue "label") , this :-> (txt . mkLabel $< (getChildren >>> getText)) ]) += (eelem "hhead" += how) += (eelem "hbody" += (txt $< (getChildren >>> getText))))) where mkLabel s = "name"++(show $ hash s)
894
false
true
1
20
549
243
120
123
null
null
DougBurke/swish
tests/N3ParserTest.hs
lgpl-2.1
pa = Res $ makeNSScopedName basea "b"
37
pa = Res $ makeNSScopedName basea "b"
37
pa = Res $ makeNSScopedName basea "b"
37
false
false
3
5
6
21
7
14
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x2F9BC' = "\x8728"
34
decomposeChar '\x2F9BC' = "\x8728"
34
decomposeChar '\x2F9BC' = "\x8728"
34
false
false
0
5
3
9
4
5
null
null
xanxys/mmterm
Main.hs
bsd-3-clause
instantiateView :: Message -> IO Widget instantiateView (StringMessage x)=do l <- labelNew (Just x) set l [miscXalign := 0] return $ castToWidget l
159
instantiateView :: Message -> IO Widget instantiateView (StringMessage x)=do l <- labelNew (Just x) set l [miscXalign := 0] return $ castToWidget l
159
instantiateView (StringMessage x)=do l <- labelNew (Just x) set l [miscXalign := 0] return $ castToWidget l
119
false
true
0
10
34
68
31
37
null
null
tomahawkins/powerpc
Language/PowerPC/RTL.hs
bsd-3-clause
-- | Less than or equal. (<=.) :: E -> E -> E a <=. b = Not (a >. b)
69
(<=.) :: E -> E -> E a <=. b = Not (a >. b)
44
a <=. b = Not (a >. b)
23
true
true
0
9
21
39
20
19
null
null
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
mpl-2.0
-- | The usage price of the Reserved Instance, per hour. rioUsagePrice :: Lens' ReservedInstancesOffering (Maybe Double) rioUsagePrice = lens _rioUsagePrice (\s a -> s { _rioUsagePrice = a })
191
rioUsagePrice :: Lens' ReservedInstancesOffering (Maybe Double) rioUsagePrice = lens _rioUsagePrice (\s a -> s { _rioUsagePrice = a })
134
rioUsagePrice = lens _rioUsagePrice (\s a -> s { _rioUsagePrice = a })
70
true
true
1
9
29
52
25
27
null
null
snoyberg/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
punc_RDR, ident_RDR, symbol_RDR :: RdrName punc_RDR = dataQual_RDR lEX (fsLit "Punc")
100
punc_RDR, ident_RDR, symbol_RDR :: RdrName punc_RDR = dataQual_RDR lEX (fsLit "Punc")
100
punc_RDR = dataQual_RDR lEX (fsLit "Punc")
57
false
true
0
7
25
26
15
11
null
null
PinkFLoyd92/PiAssist
input-script-parser/src/InputModels.hs
gpl-3.0
minusPunches :: FrameInput -> PunchCombination -> FrameInput input `minusPunches` newPunches = FrameInput (arrows input) (punches input `minusC` newPunches) (kicks input)
174
minusPunches :: FrameInput -> PunchCombination -> FrameInput input `minusPunches` newPunches = FrameInput (arrows input) (punches input `minusC` newPunches) (kicks input)
174
input `minusPunches` newPunches = FrameInput (arrows input) (punches input `minusC` newPunches) (kicks input)
113
false
true
1
8
23
61
29
32
null
null
abakst/symmetry
background/simple-sessions/ping.hs
mit
main :: IO () main = runSession $ io newRendezvous >>>= \r -> (forkSession $ accept r pingSession) >>>= \_ -> request r pingSession
141
main :: IO () main = runSession $ io newRendezvous >>>= \r -> (forkSession $ accept r pingSession) >>>= \_ -> request r pingSession
141
main = runSession $ io newRendezvous >>>= \r -> (forkSession $ accept r pingSession) >>>= \_ -> request r pingSession
127
false
true
4
9
33
68
31
37
null
null
trxeste/wrk
haskell/TrabalhoIA/src/AStar.hs
bsd-3-clause
astarSearch :: (Eq a, Hashable a) => a -> (a -> Bool) -> (a -> [(a, Int)]) -> (a -> Int) -> Maybe (Int, [a]) astarSearch startNode isGoalNode nextNodeFn heuristic = astar (PQ.singleton (heuristic startNode) (startNode, 0)) Set.empty (Map.singleton startNode 0) Map.empty where astar pq seen gscore tracks | PQ.null pq = Nothing | isGoalNode node = Just (gcost, findPath tracks node) | Set.member node seen = astar pq' seen gscore tracks | otherwise = astar pq'' seen' gscore' tracks' where (node, gcost) = snd . PQ.findMin $ pq pq' = PQ.deleteMin pq seen' = Set.insert node seen successors = filter (\(s, g, _) -> not (Set.member s seen') && (not (s `Map.member` gscore) || g < (fromJust . Map.lookup s $ gscore))) $ successorsAndCosts node gcost pq'' = foldl' (\q (s, g, h) -> PQ.insert (g + h) (s, g) q) pq' successors gscore' = foldl' (\m (s, g, _) -> Map.insert s g m) gscore successors tracks' = foldl' (\m (s, _, _) -> Map.insert s node m) tracks successors successorsAndCosts node gcost = map (\(s, g) -> (s, gcost + g, heuristic s)) . nextNodeFn $ node findPath tracks node = if Map.member node tracks then findPath tracks (fromJust . Map.lookup node $ tracks) ++ [node] else [node]
1,413
astarSearch :: (Eq a, Hashable a) => a -> (a -> Bool) -> (a -> [(a, Int)]) -> (a -> Int) -> Maybe (Int, [a]) astarSearch startNode isGoalNode nextNodeFn heuristic = astar (PQ.singleton (heuristic startNode) (startNode, 0)) Set.empty (Map.singleton startNode 0) Map.empty where astar pq seen gscore tracks | PQ.null pq = Nothing | isGoalNode node = Just (gcost, findPath tracks node) | Set.member node seen = astar pq' seen gscore tracks | otherwise = astar pq'' seen' gscore' tracks' where (node, gcost) = snd . PQ.findMin $ pq pq' = PQ.deleteMin pq seen' = Set.insert node seen successors = filter (\(s, g, _) -> not (Set.member s seen') && (not (s `Map.member` gscore) || g < (fromJust . Map.lookup s $ gscore))) $ successorsAndCosts node gcost pq'' = foldl' (\q (s, g, h) -> PQ.insert (g + h) (s, g) q) pq' successors gscore' = foldl' (\m (s, g, _) -> Map.insert s g m) gscore successors tracks' = foldl' (\m (s, _, _) -> Map.insert s node m) tracks successors successorsAndCosts node gcost = map (\(s, g) -> (s, gcost + g, heuristic s)) . nextNodeFn $ node findPath tracks node = if Map.member node tracks then findPath tracks (fromJust . Map.lookup node $ tracks) ++ [node] else [node]
1,413
astarSearch startNode isGoalNode nextNodeFn heuristic = astar (PQ.singleton (heuristic startNode) (startNode, 0)) Set.empty (Map.singleton startNode 0) Map.empty where astar pq seen gscore tracks | PQ.null pq = Nothing | isGoalNode node = Just (gcost, findPath tracks node) | Set.member node seen = astar pq' seen gscore tracks | otherwise = astar pq'' seen' gscore' tracks' where (node, gcost) = snd . PQ.findMin $ pq pq' = PQ.deleteMin pq seen' = Set.insert node seen successors = filter (\(s, g, _) -> not (Set.member s seen') && (not (s `Map.member` gscore) || g < (fromJust . Map.lookup s $ gscore))) $ successorsAndCosts node gcost pq'' = foldl' (\q (s, g, h) -> PQ.insert (g + h) (s, g) q) pq' successors gscore' = foldl' (\m (s, g, _) -> Map.insert s g m) gscore successors tracks' = foldl' (\m (s, _, _) -> Map.insert s node m) tracks successors successorsAndCosts node gcost = map (\(s, g) -> (s, gcost + g, heuristic s)) . nextNodeFn $ node findPath tracks node = if Map.member node tracks then findPath tracks (fromJust . Map.lookup node $ tracks) ++ [node] else [node]
1,304
false
true
8
18
433
535
292
243
null
null
TransformingMusicology/libaudioDB-haskell
src/Sound/Audio/Database/Query.hs
gpl-3.0
-- NOTE: This collection of multi-pass query execution functions make -- the single call to initQ (which is always the queryStart function) -- with i = 0; then the *first* call to iterQ will be made with i = -- 1. So you never get a call to iterQ with i = 0. Consequently, when -- you want to use the step argument to a QueryAllocator, -- QueryTransformer, or QueryComplete function, you need to bear in -- mind that you start from 1, at the second iteration. queryWithCallbackPtr :: (Ptr ADB) -> QueryAllocator -> QueryCallback a -> QueryComplete -> IO ADBQueryResultsPtr queryWithCallbackPtr adb alloc callback isFinished = unsafeWithQueryPtr adb alloc (\qPtr -> do let iteration = 0 initQ _ = queryStart adb qPtr stepQ i r = callback i r >> queryStep adb qPtr r >>= iterQ (i + 1) iterQ i r = isFinished i alloc r >>= thenElseIfM (do { freeQSpecDatum qPtr; return r }) (stepQ i r) r0 <- initQ iteration iterQ (iteration + 1) r0)
1,121
queryWithCallbackPtr :: (Ptr ADB) -> QueryAllocator -> QueryCallback a -> QueryComplete -> IO ADBQueryResultsPtr queryWithCallbackPtr adb alloc callback isFinished = unsafeWithQueryPtr adb alloc (\qPtr -> do let iteration = 0 initQ _ = queryStart adb qPtr stepQ i r = callback i r >> queryStep adb qPtr r >>= iterQ (i + 1) iterQ i r = isFinished i alloc r >>= thenElseIfM (do { freeQSpecDatum qPtr; return r }) (stepQ i r) r0 <- initQ iteration iterQ (iteration + 1) r0)
660
queryWithCallbackPtr adb alloc callback isFinished = unsafeWithQueryPtr adb alloc (\qPtr -> do let iteration = 0 initQ _ = queryStart adb qPtr stepQ i r = callback i r >> queryStep adb qPtr r >>= iterQ (i + 1) iterQ i r = isFinished i alloc r >>= thenElseIfM (do { freeQSpecDatum qPtr; return r }) (stepQ i r) r0 <- initQ iteration iterQ (iteration + 1) r0)
547
true
true
0
18
359
209
103
106
null
null
k0001/pipes-zlib
src/Pipes/Zlib.hs
bsd-3-clause
compress :: forall m r . MonadIO m => CompressionLevel -> Z.WindowBits -> Producer B.ByteString m r -- ^ Decompressed stream -> Producer' B.ByteString m r -- ^ Compressed stream compress (CompressionLevel clevel) wbits p0 = do def <- liftIO (Z.initDeflate clevel wbits) res <- go def p0 fromPopper (Z.finishDeflate def) pure res where go :: Deflate -> Producer B.ByteString m b -> Producer' B.ByteString m b go def = fix $ \k p -> do lift (next p) >>= \case Left r -> pure r Right (bs, p') -> do fromPopper =<< liftIO (Z.feedDeflate def bs) k p'
633
compress :: forall m r . MonadIO m => CompressionLevel -> Z.WindowBits -> Producer B.ByteString m r -- ^ Decompressed stream -> Producer' B.ByteString m r compress (CompressionLevel clevel) wbits p0 = do def <- liftIO (Z.initDeflate clevel wbits) res <- go def p0 fromPopper (Z.finishDeflate def) pure res where go :: Deflate -> Producer B.ByteString m b -> Producer' B.ByteString m b go def = fix $ \k p -> do lift (next p) >>= \case Left r -> pure r Right (bs, p') -> do fromPopper =<< liftIO (Z.feedDeflate def bs) k p'
610
compress (CompressionLevel clevel) wbits p0 = do def <- liftIO (Z.initDeflate clevel wbits) res <- go def p0 fromPopper (Z.finishDeflate def) pure res where go :: Deflate -> Producer B.ByteString m b -> Producer' B.ByteString m b go def = fix $ \k p -> do lift (next p) >>= \case Left r -> pure r Right (bs, p') -> do fromPopper =<< liftIO (Z.feedDeflate def bs) k p'
442
true
true
0
19
186
254
118
136
null
null
rahulmutt/ghcvm
compiler/Eta/HsSyn/HsExpr.hs
bsd-3-clause
-- Drop the inner contexts when reporting errors, else we get -- Unexpected transform statement -- in a transformed branch of -- transformed branch of -- transformed branch of monad comprehension pprStmtContext (ParStmtCtxt c) | opt_PprStyle_Debug = sep [ptext (sLit "parallel branch of"), pprAStmtContext c] | otherwise = pprStmtContext c
376
pprStmtContext (ParStmtCtxt c) | opt_PprStyle_Debug = sep [ptext (sLit "parallel branch of"), pprAStmtContext c] | otherwise = pprStmtContext c
154
pprStmtContext (ParStmtCtxt c) | opt_PprStyle_Debug = sep [ptext (sLit "parallel branch of"), pprAStmtContext c] | otherwise = pprStmtContext c
154
true
false
1
10
86
57
29
28
null
null
markus1189/xmonad-contrib-710
XMonad/Actions/DynamicWorkspaces.hs
bsd-3-clause
-- | Add a new hidden workspace with the given name, or do nothing if -- a workspace with the given name already exists. addHiddenWorkspace :: String -> X () addHiddenWorkspace newtag = whenX (gets (not . tagMember newtag . windowset)) $ do l <- asks (layoutHook . config) windows (addHiddenWorkspace' newtag l) -- | Remove the current workspace if it contains no windows.
385
addHiddenWorkspace :: String -> X () addHiddenWorkspace newtag = whenX (gets (not . tagMember newtag . windowset)) $ do l <- asks (layoutHook . config) windows (addHiddenWorkspace' newtag l) -- | Remove the current workspace if it contains no windows.
262
addHiddenWorkspace newtag = whenX (gets (not . tagMember newtag . windowset)) $ do l <- asks (layoutHook . config) windows (addHiddenWorkspace' newtag l) -- | Remove the current workspace if it contains no windows.
225
true
true
0
12
76
88
42
46
null
null
Concelo/concelo
src/Database/Concelo/Trie.hs
bsd-3-clause
isLeaf = V.isLeaf . run
23
isLeaf = V.isLeaf . run
23
isLeaf = V.isLeaf . run
23
false
false
2
5
4
17
6
11
null
null
brendanhay/gogol
gogol-storage/gen/Network/Google/Resource/Storage/Objects/Patch.hs
mpl-2.0
-- | Apply a predefined set of access controls to this object. opPredefinedACL :: Lens' ObjectsPatch (Maybe ObjectsPatchPredefinedACL) opPredefinedACL = lens _opPredefinedACL (\ s a -> s{_opPredefinedACL = a})
217
opPredefinedACL :: Lens' ObjectsPatch (Maybe ObjectsPatchPredefinedACL) opPredefinedACL = lens _opPredefinedACL (\ s a -> s{_opPredefinedACL = a})
154
opPredefinedACL = lens _opPredefinedACL (\ s a -> s{_opPredefinedACL = a})
82
true
true
0
9
36
48
25
23
null
null
jinjor/poorscript
src/Parser.hs
mit
keyValue :: Parser (String, A.Expression) keyValue = do key <- many alphaNum padded $ char ':' value <- expression return (key, value)
152
keyValue :: Parser (String, A.Expression) keyValue = do key <- many alphaNum padded $ char ':' value <- expression return (key, value)
152
keyValue = do key <- many alphaNum padded $ char ':' value <- expression return (key, value)
110
false
true
0
8
39
61
29
32
null
null
sashabu/libcspm
src/CSPM/Syntax/Types.hs
bsd-3-clause
splitDotable (TDotable t1 t2) = ([t1], t2)
42
splitDotable (TDotable t1 t2) = ([t1], t2)
42
splitDotable (TDotable t1 t2) = ([t1], t2)
42
false
false
0
7
6
26
14
12
null
null
alexander-at-github/eta
compiler/ETA/TypeCheck/TcType.hs
bsd-3-clause
getDFunTyKey (AppTy fun _) = getDFunTyKey fun
47
getDFunTyKey (AppTy fun _) = getDFunTyKey fun
47
getDFunTyKey (AppTy fun _) = getDFunTyKey fun
47
false
false
0
7
8
20
9
11
null
null
23Skidoo/erp
ERP.hs
gpl-3.0
ifThenElse :: AST -> AST -> AST -> AST ifThenElse cond br1 br2 = AIfThenElse cond br1 br2
89
ifThenElse :: AST -> AST -> AST -> AST ifThenElse cond br1 br2 = AIfThenElse cond br1 br2
89
ifThenElse cond br1 br2 = AIfThenElse cond br1 br2
50
false
true
0
9
17
42
19
23
null
null