[Haskell-cafe] intToWord32

John Velman velman at cox.net
Thu Oct 28 12:55:09 EDT 2004

I'm trying to test TclHaskell under Hugs98-Nov2003, compiled from source.

My current problem with getting it to work seems to be a failure to load
the function intToWord32.

Well, here is a partial transcript of a session run from within the
TclHaskell src directory (after compiling TclPrim.so):


bash-2.05b$ hugs
__   __ __  __  ____   ___      _________________________________________
||   || ||  || ||  || ||__      Hugs 98: Based on the Haskell 98 standard
||___|| ||__|| ||__||  __||     Copyright (c) 1994-2003
||---||         ___||           World Wide Web: http://haskell.org/hugs
||   ||                         Report bugs to: hugs-bugs at haskell.org
||   || Version: November 2003  _________________________________________

Haskell 98 mode: Restart with command line option -98 to enable extensions

Type :? for help
Prelude> :load "../demo/Demo.hs"
ERROR "./TclPrim.hs":49 - Undefined variable "intToWord32"
Word> :names
Hugs.Array.! Hugs.Prelude.!! Hugs.Prelude.$ Hugs.Prelude.$! Hugs.Prelude.%
Hugs.Prelude.&& Hugs.Prelude.() Hugs.Prelude.* Hugs.Prelude.** Hugs.Prelude.+

....[snipped many lines]

Hugs.Int.intToInt16 Hugs.Int.intToInt32 Hugs.Int.intToInt8
Hugs.Prelude.intToRatio Hugs.Word.intToWord16 Hugs.Word.intToWord32
... [snipped the rest]


So ':names' thinks there is such a thing, but the loader doesn't?

I see that intToWord32 is declared with the keyword "primitive"  -- i.e.,
specifically, from Word.hs in the library:

primitive intToWord32 "intToWord32" :: Int    -> Word32

I'm having trouble finding this syntax in the documentation, but, as I
recall -- perhaps incorrectly -- I ran across some gopher documentation
that indicated that the "intToWord32" in quotation marks was supposed to be
the file name where the foreign primitive could be found.   Using "locate"
I can't find any files by the name of "intToWord32" in my system.   Perhaps
this is the Undefined variable in question.

Finally, I'm running on a Linux system, Slackware 9, 400Mhz pentium II,
128 mb memory.

Any advice or references to documentation will be appreciated.

(By the way -- I decided to try TclHaskell because it seemed to be the
simplest way to get a graphical interface to an application going!  Any
advice here will be appreciated as well.)


John Velman

More information about the Haskell-Cafe mailing list