[Haskell-cafe] wxHaskell and do statements

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Mon Nov 28 11:25:10 EST 2005


mempko <mempko at gmail.com> writes:

> Hello, I have a program that just will not compile and I cannot figure 
> out why.

Wrong indentation.  Tab stops are 8 spaces in Haskell, but your code
seems to assume 6 spaces.

> -------------------------
> module Main where
> 
> import Graphics.UI.WX
> 
> main :: IO ()
> main = start hello
> 
> hello :: IO ()
> hello = do f <- frame [text := "Super Window"]
> 		lab <- staticText f [text:= "Hello"]

The 'lab <-' actually lines up with 'frame', not with 'f <-' as intended.

Regards,
    Malcolm


More information about the Haskell-Cafe mailing list