I just this minute downloaded the self extracting Win32 Hugs and tried this:

module Hello where
import Graphics

helloWorld :: IO ()
helloWorld = runGraphics (do
    w <- openWindow "Hello World Window" (300, 300)
    draw w (text (100, 100) "Hello")
    draw w (text (100, 200) "World")
    getKey w
    closeWindow w
    )

which I got from a document somewhere.  Maybe it wasnt supposed to work at
all with what Id installed, but Im not so sure about that because it was
happy with openWindow, and only barfed at draw:

ERROR "C:\Programs\funclang\hugs\hw.hs" (line 5): Undefined constructor
function
 "draw"

I checked through the list of Reading file "foo"s, but couldnt find any
mention of not being able to find any files.  Id love to be able to get on
with my Windows program though, so if you solve it, please mail the answer
to me.

Adrian.

PS.

I just tried importing Win32 and got:

ERROR "C:\Programs\funclang\hugs\hw.hs": Entity "readFile" imported from
module
"Win32" already defined in module "Prelude"

Can this be right?  Im trying to get away from the boring mainstream
languages, but if I cant even get Hello World to work I may be facing an
uphill struggle.


Reply via email to