Haskell Language Modules

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9


  • module Name where -- export all names declared in this file

  • module Name (functionOne, Type (..)) where -- export only functionOne, Type, and Type's constructors

  • import Module -- import all of Module's exported names

  • import qualified Module as MN -- qualified import

  • import Module (justThisFunction) -- import only certain names from a module

  • import Module hiding (functionName, Type) -- import all names from a module except functionName and Type


Haskell has support for modules:

  • a module can export all, or a subset of its member types & functions

  • a module can "re-export" names it imported from other modules

On the consumer end of a module, one can:

  • import all, or a subset of module members

  • hide imports of a particular member or set of members

haskell.org has a great chapter on module definition.

Got any Haskell Language Question?