[Haskell-cafe] Noob error: Type b -> c b Does not match IO a

Cale Gibbard cgibbard at gmail.com
Sun Jun 26 02:02:16 EDT 2005

Oops, somehow that reply by Scott Turner (which coincidentally
contained the same example) hadn't appeared for me yet :)
Anyway, seconded :)

On 26/06/05, Cale Gibbard <cgibbard at gmail.com> wrote:
> Well, the case of the built-in numeric types is somewhat different,
> but most functions automatically short circuit, since Haskell uses
> lazy evaluation.
> For instance, it's perfectly okay to define
> myAnd = foldr (&&) True
> Note that this terminates on infinite lists which contain False as a value:
> myAnd (False : repeat True)
> will evaluate to False pretty much immediately.
>  - Cale

More information about the Haskell-Cafe mailing list