Skip to content

Commit

Permalink
MonadFail forward-compat
Browse files Browse the repository at this point in the history
Drop redundant unused `fail` method in internal instance; if it had
been relevant we would have had to define a `MonadFail`-instance for
it already.
  • Loading branch information
hvr committed Dec 18, 2018
1 parent 69d625b commit 96149a4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Data/Text/Internal/Read.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ instance Monad (IParser t) where
Left err -> Left err
Right (a,t') -> runP (k a) t'
{-# INLINE (>>=) #-}
fail msg = P $ \_ -> Left msg

-- If we ever need a `MonadFail` instance the definition below can be used
--
-- > instance MonadFail (IParser t) where
-- > fail msg = P $ \_ -> Left msg
--
-- But given the code compiles fine with a post-MFP GHC 8.6+ we don't need
-- one just yet.

data T = T !Integer !Int

Expand Down

0 comments on commit 96149a4

Please sign in to comment.