diff options
author | simonmar <unknown> | 2002-04-26 11:18:57 +0000 |
---|---|---|
committer | simonmar <unknown> | 2002-04-26 11:18:57 +0000 |
commit | 31c53d79c85274012725480b8d78d341f3affe06 (patch) | |
tree | 6c005e5816372d8a6455713debe6b3f0290ecf8c /src/HaddockParse.y | |
parent | bbd5fbab2ffebe759f20765a4dbd519b2d1381d8 (diff) |
[haddock @ 2002-04-26 11:18:56 by simonmar]
- support for fundeps (partially contributed by Brett Letner - thanks
Brett).
- make it build with GHC 4.08.2
Diffstat (limited to 'src/HaddockParse.y')
-rw-r--r-- | src/HaddockParse.y | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/HaddockParse.y b/src/HaddockParse.y index 0c5ebf49..6e0f8b6f 100644 --- a/src/HaddockParse.y +++ b/src/HaddockParse.y @@ -3,8 +3,6 @@ module HaddockParse (parseParas, parseString) where import HaddockLex import HaddockTypes - -import MonadError } %tokentype { Token } @@ -59,5 +57,13 @@ elem :: { ParsedDoc } { happyError :: [Token] -> Either String a happyError toks = - throwError ("parse error in doc string: " ++ show (take 3 toks)) + Left ("parse error in doc string: " ++ show (take 3 toks)) + +-- Either monad (we can't use MonadError because GHC < 5.00 has +-- an older incompatible version). +instance Monad (Either String) where + return = Right + Left l >>= _ = Left l + Right r >>= k = k r + fail msg = Left msg } |