[Haskell-cafe] What is an "expected type" ...

Martijn van Steenbergen martijn at van.steenbergen.nl
Sun Jun 28 11:24:07 EDT 2009


Hi Michael,

michael rice wrote:
> as opposed to an "inferred type"?

Can you deduce from the following example?

> Prelude> let foo = () :: Int
> <interactive>:1:10:
>     Couldn't match expected type `Int' against inferred type `()'
>     In the expression: () :: Int
>     In the definition of `foo': foo = () :: Int
> 

Hope this helps!

Martijn.



More information about the Haskell-Cafe mailing list