GHCi :type and :kind commands

  • Examples
  • Type defaulting
  • Type parameter order
    • Caveat
  • Querying kinds
    • Constraints

GHCi has always (so far as we know) had a command for querying the type of a function, and that is :type. It can be used to ask for the type of a data constructor or function, whether from your own source file or from any dependency, so long as it is in scope. Recently, there have been some new extensions to that command, and those are covered here. Since the :kind command is so closely related to the :type command, we’ve chosen to cover that here as well rather than giving it its own page.

Sign up for access to the full page, plus the complete archive and all the latest content.