[Hugs-users] Can't find Preclude

Ross Paterson ross at soi.city.ac.uk
Sat Sep 16 05:45:03 EDT 2006


On Sat, Sep 16, 2006 at 02:13:01PM +0800, Forest Liu wrote:
> When I launch hugs, it does not display "reading Preclude.hs" or like
> as the book describes.

Modern versions are quieter, but the Prelude (no "c") has been loaded.
(If you run hugs -q +w you'll see all that stuff.)

> When I am running some simple programs from the book "Haskell: The
> Craft of Functional Programming", the error occurs to say cannot find
> 'ord', 'chr', or 'fromInt' and so on what I think should be defined in
> Preclude. But 'max' and 'min' goes correctly.

Older versions of Hugs did have 'ord', 'chr', or 'fromInt' in the
Prelude, but this was contrary to the definition of Haskell 98.

To use 'ord' and 'chr', you need to load the Char module (or import
it from your source module).

Instead of 'fromInt', use 'fromIntegral'.



More information about the Hugs-Users mailing list