[Haskell-cafe] Re: Crashing - First Graphics Program in Haskell School of Expression(HSOE)

Achim Schneider barsoap at web.de
Fri Apr 10 07:05:02 EDT 2009


Raja Koduru <kscraja at gmail.com> wrote:

> Hi,
> 
> I am a beginner. Help me.
> 
> Here is my "main.hs", sample code from the book HSOE.
> ----------------------------------------------------------------
> module Main where
> import SOE
> 
> main = runGraphics (
>       do w <- openWindow "My First Graphics Program" (300, 300)
>          drawInWindow w (text (100, 100) "Hello Graphics World")
>          k <- getKey w
>          closeWindow w
>       )
> 
> ------------------------------------------------------------------
> 
> When this is run, a window pops up but it immediately crashes.
> I call "main" function after loading the above src file (main.hs) in
> ghci
> 
Does the same happen when you compile with "ghc --make" or use ":main"
in ghci? ghc and ghci behaving different[1] wrt. ffi calls isn't
unheard of.


[1] meaning that ghci fails

-- 
(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.




More information about the Haskell-Cafe mailing list