From: Ian Lynagh Date: Thu, 24 Jan 2008 15:58:27 +0000 (+0000) Subject: Make the Parser Monad's return strict X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=0c3e42b73205ec0811ab1899fa60bfdebd4ae77d Make the Parser Monad's return strict --- diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 2aa8f4f..8d2a9a5 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -1410,7 +1410,7 @@ instance Monad P where 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 ->