diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-10-18 09:37:43 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2015-10-18 09:39:26 +0200 |
commit | 1e34f6219526f747e1c0c686e447f73f6f72ed8d (patch) | |
tree | 8640861bc35b04de684dd60f3b89c18c6ed87910 /ghc | |
parent | c6781a5064049e0a7c17c1f2239567a3c44955af (diff) | |
download | haskell-1e34f6219526f747e1c0c686e447f73f6f72ed8d.tar.gz |
MRP-refactor `GHCi` Applicative/Monad instance
As GHCi is compiled by stage1+ GHC only, we can
drop the explicit `return` definition rightaway.
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GhciMonad.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs index 8c755be930..7dd005b99e 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 |