GHC error message on type mismatch
roma at ro-che.info
Fri Nov 8 07:17:03 UTC 2013
* Daniel Trstenjak <daniel.trstenjak at gmail.com> [2013-11-08 05:54:49+0100]
> Couldn't match type `A' with `B´
> Real type: B
> Given type: A
> Or instead of 'Given', like others have suggested: 'Provided' or 'Supplied'.
So far in this thread I haven't seen any suggestions better than status
Prelude> (undefined :: Int -> Bool) (undefined :: Bool)
Couldn't match expected type `Int' with actual type `Bool'
In the first argument of `undefined :: Int -> Bool', namely
`(undefined :: Bool)'
In the expression: (undefined :: Int -> Bool) (undefined :: Bool)
In an equation for `it':
it = (undefined :: Int -> Bool) (undefined :: Bool)
This one is quite clear — the compiler expected an argument of type Int,
but it was of type Bool.
Now replace this with Real and Given. Well, Bool for the function
argument is both Real and Given (I gave it this type, and it became its
real type). And calling Int either Real or Given doesn't make any sense.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: Digital signature
More information about the Glasgow-haskell-users