| I myselft don't understand why GHCi doesn't accept the type it
| infered as an explicit signature ...
I've known about this confusing behavior for some time, and the design goal
that the compiler should not infer a type that it can't check seems Clearly
Right. Stupidly, though, I had not
I myselft don't understand why GHCi doesn't accept the type it
infered as an explicit signature ...
I think it has to do with the following:
Looking at the type errors, they seem to indicate that the type
checker is being general and does not assume the |From| and |To|
relations are between
I find this interesting,
GHCi accepts a function |dmap| which I show below and infers its type,
but if I annotate the function with the inferred type, GHCi's
type-checker rejects it.
I'm trying to generalise the datatype-generic dmap:
dmap :: Bifunctor s = (a - b) - Fix s a - Fix s b
dmap f =
Hi Pablo,
On Mon, Jul 7, 2008 at 10:07 AM, Pablo Nogueira
[EMAIL PROTECTED] wrote:
GHCi infers it has type (up to renaming):
(From a1 (s (a1 x)) x, Bifunctor s, To a2 (s (a2 y)) y) = (x - y)
- a1 x - a2 y
But if I cut and paste the type into the code I get type errors:
Could not