Skip to content

:browse limitations (browsing virtual namespaces, listing namespaces)

  1. :browse cannot be used with virtual namespaces:
import Prelude ()
import qualified Data.List  as Folds(foldr)
import qualified Data.Maybe as Folds(maybe)
*Main> :browse *Main
Folds.foldr :: (a -> b -> b) -> b -> [a] -> b
Folds.maybe :: b -> (a -> b) -> Data.Maybe.Maybe a -> b
*Main> :browse *Folds
Could not find module `Folds':
  Use -v to see a list of the files searched for.

it would be useful if GHCi's :browse supported this Haskell module system feature, allowing "virtual" namespaces to be browsed just like "real" ones.

  1. to use :browse, one needs to know the precise module name

when using some packages, like OpenGL, i never can remember where in the hierarchy their modules are placed, so i can't even get started :browsing them.

(a) it would be useful if ghc-pkg functionality was part of the GHC API, and accessible from within GHCi, or if GHCi knew which instance of ghc-pkg it is associated with (:!ghc-pkg field OpenGL exposed-modules does not work unless the ghc-pkg in the PATH happens to match the GHCi in use..).

(b) it would be nicer if GHCi's :browse itself had an option to list available namespaces matching a pattern, so that one could narrow down to what one wants to :browse

Trac metadata
Trac field Value
Version 6.8.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information