The Hugs 98 User Manual
top | back | next

6  Library overview

Haskell 98 places much greater emphasis on the use of libraries than early versions of the language. Following that lead, the Hugs 98 distribution includes most of the official libraries defined in the Haskell Library Report [Haskell98libs]. The distribution also includes a number of unofficial libraries, which fall into two categories: portable libraries, which are implemented using standard Haskell or widely implemented Haskell extensions; and Hugs-specific libraries, which use features that are not available in other Haskell implementations.

All that you need to do to use libraries is to import them using an import declaration. For example:
 module MandlebrotSet where
 import Array
 import Complex
 ...
Of course, this assumes that HUGSPATH has been set to point to the directories where the libraries are stored, and that import chasing is enabled. The default search path includes the directories containing both the standard and unofficial libraries.

6.1  Standard Libraries

The Hugs 98 distribution includes the following standard libraries: Array, Char, Complex, IO, Ix, List, Locale, Maybe, Monad, Numeric, Prelude, Random, Ratio, and System. The libraries Directory, Time, and CPUTime, are not currently supported. The library report [Haskell98libs] contains full descriptions of all of theses standard libraries. Differences between the library report and the libraries supplied with Hugs are described in Section 9.

6.2  The Hugs-GHC Extension Libraries

Hugs and GHC provide a common set of libraries to aid portability; detailed specifications for these libraries are described elsewhere [HugsGHClibs]. The Hugs-GHC modules included in the current distribution include Addr, Bits, Channel, ChannelVar, Concurrent, Dynamic, Foreign, IOExts, Int, GetOpt, NumExts, Pretty, ST, LazyST, Weak, and Word. The Exception and Stable libraries are not currently supported. Note that the ST and LazyST libraries cannot be used when the interpreter is running in Haskell 98 mode; the type for runST requires support for rank-2 polymorphism, which is only available in Hugs mode. (See Section 7.3.2 for further details.)

The specifications and implementations of all of these libraries are still evolving, and are subject to change.

6.3  Portable Libraries

These libraries are not part of the Haskell standard but can be ported to most Haskell systems.

6.4  Hugs-Specific Libraries

These libraries provide several non-standard facilities for Hugs programmers. Other Haskell implementations may provide similar features, but this is not guaranteed, and there may be significant differences in organization, naming, semantics, or functionality. Other libraries included in the standard distribution, but not further documented here are Sequence, Pretty, HugsDynamic, HugsLibs, StdLibs, and OldWeak.


The Hugs 98 User Manual
top | back | next
May 22, 1999