[commit: ghc] master: MRP-refactor `GHCi` Applicative/Monad instance (1e34f62)

git at git.haskell.org git at git.haskell.org
Sun Oct 18 08:52:40 UTC 2015


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

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

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

commit 1e34f6219526f747e1c0c686e447f73f6f72ed8d
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sun Oct 18 09:37:43 2015 +0200

    MRP-refactor `GHCi` Applicative/Monad instance
    
    As GHCi is compiled by stage1+ GHC only, we can
    drop the explicit `return` definition rightaway.


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

1e34f6219526f747e1c0c686e447f73f6f72ed8d
 ghc/GhciMonad.hs | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs
index 8c755be..7dd005b 100644
--- a/ghc/GhciMonad.hs
+++ b/ghc/GhciMonad.hs
@@ -179,12 +179,11 @@ instance Functor GHCi where
     fmap = liftM
 
 instance Applicative GHCi where
-    pure = return
+    pure a = GHCi $ \_ -> pure a
     (<*>) = ap
 
 instance Monad GHCi where
   (GHCi m) >>= k  =  GHCi $ \s -> m s >>= \a -> unGHCi (k a) s
-  return a  = GHCi $ \_ -> return a
 
 getGHCiState :: GHCi GHCiState
 getGHCiState   = GHCi $ \r -> liftIO $ readIORef r



More information about the ghc-commits mailing list