explicit signatures and default for integer literals

robert dockins robdockins at fastmail.fm
Tue May 31 09:16:39 EDT 2005

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).

More information about the Glasgow-haskell-users mailing list