No import of Prelude

From HaskellWiki
Revision as of 17:53, 11 January 2008 by Lemming (talk | contribs) (from Haskell-Cafe)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Question

Is it possible not to load Prelude module when compiling a Haskell module?

Answer

You can either do

import Prelude()

or add

{-# LANGUAGE NoImplicitPrelude #-}

to the top of the module, or equivalently compile with -fno-implicit-prelude option.

import Prelude()<hask> is less aggressive than <code>NoImplicitPrelude</code>. E.g. with the first method <hask>fromInteger is still imported. It is silently inserted for number literals.

See also