projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bf1cff9
)
Make the Parser Monad's return strict
author
Ian Lynagh
<igloo@earth.li>
Thu, 24 Jan 2008 15:58:27 +0000
(15:58 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Thu, 24 Jan 2008 15:58:27 +0000
(15:58 +0000)
compiler/parser/Lexer.x
patch
|
blob
|
history
diff --git
a/compiler/parser/Lexer.x
b/compiler/parser/Lexer.x
index
2aa8f4f
..
8d2a9a5
100644
(file)
--- a/
compiler/parser/Lexer.x
+++ b/
compiler/parser/Lexer.x
@@
-1410,7
+1410,7
@@
instance Monad P where
fail = failP
returnP :: a -> P a
fail = failP
returnP :: a -> P a
-returnP a = P $ \s -> POk s a
+returnP a = a `seq` (P $ \s -> POk s a)
thenP :: P a -> (a -> P b) -> P b
(P m) `thenP` k = P $ \ s ->
thenP :: P a -> (a -> P b) -> P b
(P m) `thenP` k = P $ \ s ->