projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
3066cec
)
Functor instance for the GHCi monad
author
Pepe Iborra
<mnislaih@gmail.com>
Thu, 9 Aug 2007 16:09:33 +0000
(16:09 +0000)
committer
Pepe Iborra
<mnislaih@gmail.com>
Thu, 9 Aug 2007 16:09:33 +0000
(16:09 +0000)
compiler/ghci/GhciMonad.hs
patch
|
blob
|
history
diff --git
a/compiler/ghci/GhciMonad.hs
b/compiler/ghci/GhciMonad.hs
index
f68da83
..
82aade4
100644
(file)
--- a/
compiler/ghci/GhciMonad.hs
+++ b/
compiler/ghci/GhciMonad.hs
@@
-111,6
+111,9
@@
instance Monad GHCi where
(GHCi m) >>= k = GHCi $ \s -> m s >>= \a -> unGHCi (k a) s
return a = GHCi $ \s -> return a
+instance Functor GHCi where
+ fmap f m = m >>= return . f
+
ghciHandleDyn :: Typeable t => (t -> GHCi a) -> GHCi a -> GHCi a
ghciHandleDyn h (GHCi m) = GHCi $ \s ->
Exception.catchDyn (m s) (\e -> unGHCi (h e) s)