diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-02-15 12:39:00 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-18 20:16:07 -0500 |
commit | 40d917fb3b99bdb63e7e39d517225d441aaf722d (patch) | |
tree | 484133ca5ed916a8d349548b1ebe5d6db317bf3f /compiler/parser | |
parent | d7029cc09edc052c2f97effe33233c53340fcce0 (diff) | |
download | haskell-40d917fb3b99bdb63e7e39d517225d441aaf722d.tar.gz |
Remove the MonadFail P instance
There were two issues with this instance:
* its existence meant that a pattern match failure in the P monad would
produce a user-visible parse error, but the error message would not be
helpful to the user
* due to the MFP migration strategy, we had to use CPP in Lexer.x,
and that created issues for #17750
Updates haddock submodule.
Diffstat (limited to 'compiler/parser')
-rw-r--r-- | compiler/parser/Lexer.x | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 98c422bd4d..bee441362f 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -41,7 +41,6 @@ -- Alex "Haskell code fragment top" { -{-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiWayIf #-} @@ -57,7 +56,7 @@ module Lexer ( allocateComments, MonadP(..), getRealSrcLoc, getPState, withThisPackage, - failLocMsgP, srcParseFail, + failMsgP, failLocMsgP, srcParseFail, getErrorMessages, getMessages, popContext, pushModuleContext, setLastToken, setSrcLoc, activeContext, nextIsEOF, @@ -74,7 +73,6 @@ import GhcPrelude -- base import Control.Monad -import Control.Monad.Fail as MonadFail import Data.Bits import Data.Char import Data.List @@ -2154,12 +2152,6 @@ instance Applicative P where instance Monad P where (>>=) = thenP -#if !MIN_VERSION_base(4,13,0) - fail = MonadFail.fail -#endif - -instance MonadFail.MonadFail P where - fail = failMsgP returnP :: a -> P a returnP a = a `seq` (P $ \s -> POk s a) |