Last generator in do {...}

Andrew J Bromage ajb@spamcop.net
Wed, 30 Oct 2002 10:10:44 +1100


G'day all.

On Tue, Oct 29, 2002 at 11:20:47AM +0200, George Kosmidis wrote:

> I am sure there are a billion errors in this.
> This is the first one: 
>     Line:17 - Last generator in do {...} must be an expression 

What this means is that the compiler has interpreted the last line
of a do expression to be a generator (i.e. pat <- exp), which is
bad Haskell.

In your case, here is main:

> main=do userText<-getText

Occasionally, this may be caused by offside errors:

	main = do foo <- bar
                return foo
                ^ offside error, Haskell interprets this as not being
                  part of the do expression

Cheers,
Andrew Bromage