[parser updates
John Meacham <john@repetae.net>**20100721222450
 Ignore-this: 11ad522d9ee945882a94f0063ac6021
] hunk ./src/DerivingDrift/Drift.hs 30
-    hsMod = case runParser parse (unlines ss)  of
-        ParseOk _ e -> e
+    hsMod = case snd $ runParser parse (unlines ss)  of
+        ParseOk e -> e
hunk ./src/FrontEnd/HsParser.y 619
-      | pinfixexp srcloc rhs                   {% checkValDef $2 $1 $3 []}
-      | pinfixexp srcloc rhs 'where' decllist  {% checkValDef $2 $1 $3 $5}
+      | pinfixexp srcloc rhs optwhere          {% checkValDef $2 $1 $3 $4}
hunk ./src/FrontEnd/HsParser.y 625
+optwhere :: { [HsDecl] }
+       : 'where' decllist		{ $2 }
+       | {- empty -}			{ [] }
+
hunk ./src/FrontEnd/HsParser.y 834
-      : pinfixexp srcloc ralt  {% checkPattern $1 `thenP` \p ->
-                                 returnP (HsAlt $2 p $3 []) }
-      | pinfixexp srcloc ralt 'where' decllist
-                              {% checkPattern $1 `thenP` \p ->
-                                 returnP (HsAlt $2 p $3 $5) }
+      : pinfixexp srcloc ralt optwhere {% checkPattern $1 `thenP` \p ->
+                                 returnP (HsAlt $2 p $3 $4) }
hunk ./src/FrontEnd/Lexer.hs 157
+ ( "\x2605",  Star ),	--ditto
hunk ./src/FrontEnd/Lexer.hs 187
+ ( "\x2200",    KW_Forall ),
hunk ./src/FrontEnd/Lexer.hs 189
+ ( ['∃'],       KW_Exists ),
hunk ./src/FrontEnd/ParseMonad.hs 31
+import Data.Monoid
+import Data.Functor
hunk ./src/FrontEnd/ParseMonad.hs 37
+import qualified Control.Applicative as A
hunk ./src/FrontEnd/ParseMonad.hs 41
-	= ParseOk [Warning] a	-- ^ The parse succeeded, yielding a value and a set of warnings.
+	= ParseOk a	-- ^ The parse succeeded, yielding a value and a set of warnings.
hunk ./src/FrontEnd/ParseMonad.hs 58
+
+instance Functor ParseResult where
+    fmap f (ParseOk x) = ParseOk (f x)
+    fmap _ (ParseFailed x y) = ParseFailed x y
+
+instance A.Applicative ParseResult where
+  pure = ParseOk
+  ParseOk f <*> x = f <$> x
+  ParseFailed loc msg <*> _ = ParseFailed loc msg
+
+instance Monad ParseResult where
+  return = A.pure
+  ParseOk x         >>= f = f x
+  ParseFailed loc msg >>= _ = ParseFailed loc msg
+
+instance Monoid m => Monoid (ParseResult m) where
+  mempty = ParseOk mempty
+  ParseOk x `mappend` ParseOk y = ParseOk $ x `mappend` y
+  ParseOk x `mappend` err       = err
+  err       `mappend` _         = err -- left-biased
+
hunk ./src/FrontEnd/ParseMonad.hs 126
-runParserWithMode :: ParseMode -> P a -> String -> ParseResult a
+runParserWithMode :: ParseMode -> P a -> String -> ([Warning],ParseResult a)
hunk ./src/FrontEnd/ParseMonad.hs 128
-	Ok s a -> ParseOk (psWarnings s) a
-	Failed loc msg -> ParseFailed loc msg
+	Ok s a -> (psWarnings s,ParseOk a)
+	Failed loc msg -> ([],ParseFailed loc msg)
hunk ./src/FrontEnd/ParseMonad.hs 136
-runParser :: P a -> String -> ParseResult a
+runParser :: P a -> String -> ([Warning],ParseResult a)
hunk ./src/Ho/Build.hs 694
-                      ParseOk ws e -> processErrors ws >> return (e,LBSU.fromString s')
-                      ParseFailed sl err -> putErrDie $ show sl ++ ": " ++ err
+                      (ws,ParseOk e) -> processErrors ws >> return (e,LBSU.fromString s')
+                      (_,ParseFailed sl err) -> putErrDie $ show sl ++ ": " ++ err
hunk ./src/Interactive.hs 166
-parseStmt s = case runParserWithMode (parseModeOptions options) { parseFilename = "(jhci)" } parseHsStmt  s  of
-                      ParseOk _ e -> return e
+parseStmt s = case snd $ runParserWithMode (parseModeOptions options) { parseFilename = "(jhci)" } parseHsStmt  s  of
+                      ParseOk e -> return e