Skip to content

:info enhancements

:info is a very useful ghci command, but there are several improvements that could be made:

  1. It would be useful if :i showed not only which module a name is defined in, but which module(s) it was imported from in the current session.
  2. A variant of :i that just prints a definition, rather than a definition and all instances, would be useful in many cases. E.g. :i Show prints the definition of Show, but then it prints so many instances that the definition is scrolled way off the screen.
  3. :i -> is a parse error; it should behave like :i (->), the way it works for other type-level operators.
  4. hvr had some more suggestions: "finding out which package a module belongs to", "and what module an 'as'-alias is associated with". (Currently I think modules are out of :info's scope, but perhaps it would be a useful addition.)
Edited by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information