| If I enter fromInt 5 at the hugs prompt, I get 5. If I use fromInt 5 in >a module and try to load the | module, I'm told that fromInt is undefined, >unless I explicitly import Hugs.Prelude.
Same with toInt, fromDouble. Evidently a mismatch between the exports of Hugs.Prelude and the imports of Prelude.hs.
These are internal functions of the Hugs implementation of the Prelude, and not part of standard Haskell. It's a bug that they're visible when no module is loaded. (The names in scope are always those in scope inside the current module, and in this case that's the Prelude.)
Then it's very unfortunate that a standard textbook such as Thompson uses fromInt and doesn't even mention fromIntegral, which I presume is the politically correct alternative.
| Then it's very unfortunate that a standard textbook such as | Thompson uses fromInt and doesn't even mention fromIntegral, | which I presume is the politically correct alternative. I don't think you said anything about which version of Hugs you are using. It might be irritating, but it shouldn't be too surprising that you will encounter problems if you try to use a recent release with a textbook that is, if I recall correctly, about five years old. Does the book actually mention which version of Hugs it used? Or maybe that information, or instructions on how to use it with later versions of Hugs, is on the book's web page? Maybe the distribution itself is there, or perhaps you could ask the author? Once you have that information, then maybe you might find a more suitable version in the Hugs archive at (http://www.cse.ogi.edu/~mpj/hugsarc), on some other web site, or by polling to see if others have a copy of the one you need. I'm pretty sure I have copies of Hugs from 1999, 2000, and 2001 that I could add to the archive if that were useful. All the best, Mark
participants (2)
-
Bob Tennent -
Mark P Jones