GHCI Tip: Get the names of all functions in a module
Have a module and want to know what functions it exposes without opening up the source? Or what if you don't have the source but want to know what you can do with it?
Simple:
ghci> :load AModule.hs [1 of 1] Compiling Just.AModule ( AModule.hs, interpreted ) Ok, modules loaded: Just.AModule. ghci> -- notice the name of the module loaded ghci> :browse Just.AModule data Cat a = Cat a getName :: Cat a -> a newName :: a -> Cat a
Yes this module is dumb. The key here is the :browse command. Perhaps "overview" or "summary" would have been better names, but I think browse is fairly descriptive.













