Did something like this (and a bit more) a few years ago and wrote it up as a tutorial. No idea whether it'll still work, but have a look
http://www.haskell.org/haskellwiki/Ghci#Using_.ghci.2C_a_mini-tutorial
Frage
I'd like to write a GHCi macro that augments :browse
by filtering the list of results (basically, a simple grep
for :browse:
output). For example, to see all output that includes the word Monad
:
Prelude> :mybrowse Prelude Monad
(=<<) :: Monad m => (a -> m b) -> m a -> m b
class Monad m where
mapM :: Monad m => (a -> m b) -> [a] -> m [b]
mapM_ :: Monad m => (a -> m b) -> [a] -> m ()
sequence :: Monad m => [m a] -> m [a]
sequence_ :: Monad m => [m a] -> m ()
Prelude>
I can't see a way to implement this using :def
. Is there a way?
Lösung
Did something like this (and a bit more) a few years ago and wrote it up as a tutorial. No idea whether it'll still work, but have a look
http://www.haskell.org/haskellwiki/Ghci#Using_.ghci.2C_a_mini-tutorial