[commit: ghc] master: Minor fix of MonadFail instance for `ReadPrec` (b469b30)

git at git.haskell.org git at git.haskell.org
Fri Jan 1 00:56:27 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b469b308351cf6120e335bf2127c13ec56b6c381/ghc

>---------------------------------------------------------------

commit b469b308351cf6120e335bf2127c13ec56b6c381
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Fri Jan 1 01:50:07 2016 +0100

    Minor fix of MonadFail instance for `ReadPrec`
    
    This fixes the instance to be semantically cleaner but other than that
    this fix has no practical consequences as the implementations of
    `Monad(fail)` and `MonadFail(fail)` for `ReadP` coincide.


>---------------------------------------------------------------

b469b308351cf6120e335bf2127c13ec56b6c381
 libraries/base/Text/ParserCombinators/ReadPrec.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/base/Text/ParserCombinators/ReadPrec.hs b/libraries/base/Text/ParserCombinators/ReadPrec.hs
index 2a9c1d0..4306c6e 100644
--- a/libraries/base/Text/ParserCombinators/ReadPrec.hs
+++ b/libraries/base/Text/ParserCombinators/ReadPrec.hs
@@ -85,7 +85,7 @@ instance Monad ReadPrec where
   P f >>= k = P (\n -> do a <- f n; let P f' = k a in f' n)
 
 instance MonadFail.MonadFail ReadPrec where
-  fail s    = P (\_ -> fail s)
+  fail s    = P (\_ -> MonadFail.fail s)
 
 instance MonadPlus ReadPrec
 



More information about the ghc-commits mailing list