I am a totally new user to haskell and hugs. I am working on Mac OS X 10.4.7(intel), and compile the hugs src myself(configure, make, make install), and than generate the hugs under /usr/local/bin and /usr/local/lib/hugs normally. When I launch hugs, it does not display "reading Preclude.hs" or like as the book describes. 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. I try to 'import Preclude' at the start line in the program, it says cannot find module Preclude. And I tried other packages, also cannot be found. Generally, I can't find where to load Preclude.hs manually or automately at startup. -- Sincerely, Forest Liu(�����S)
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'.
participants (2)
-
Forest Liu -
Ross Paterson