A better `:browse` command (GHCi)

Viewed 387

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?

1 Answers
Related