
31 May
2005
31 May
'05
9:16 a.m.
Dinko Tenev wrote:
First we observe that, g = new . flip zip [0..], so, without the type specification, it has the general type (New [(a, b1)] b, Num b1, Enum b1) => [a] -> b, as reported by GHC.
Then we infer from
(1) g :: (New [(u, v)] w, Num v, Enum v) => [u] -> w
and
(2) instance New [(a, b)] (Map a b)
that in (New [(u, v)] w), w can only be (Map u v)
This step in the reasoning requires a functional dependency, which you mentioned earlier you were unwilling to supply. Without functional dependencies w can, in fact, be something other than (Map u v).