Marc van Dongen writes:
>
 ..
> 
> The following program:
> 
> > module Main( main ) where
> > main = putStr (seq bot "1\n") >>
> >        return ()
> >      where bot = error []
> 
> cannot be compiled:
> Main.lhs:1: Ambiguous context `{PrelBase.Eval tans}'
>                `PrelBase.Eval tans' arising from use of `Prelude.seq' at Main.lhs:4
> 

Hi,

this seems like a fair response to me (modulo the use of 'tans' rather
than 'a'), 'bot' has type alpha, but 'seq' requires its first argument
to be an instance of Eval.

>
> The folowing program
> 
> > module Main( main ) where
> > main = putStr (seq bot "1\n") >>
> >        return ()
> >      where bot | 0 == 1 = []
> 
> outputs:
> 
> 1

This time bot has type '[alpha]' for which there is an Eval instance,
i.e., evaluate the list to WHNF.

HTH,
--Sigbjorn

Reply via email to