explicit signatures and default for integer literals

Dinko Tenev dinko.tenev at gmail.com
Tue May 31 11:18:16 EDT 2005


On 5/31/05, robert dockins <robdockins at fastmail.fm> wrote:
> 
> 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).

We need to infer New [(u, v)] w, and the only thing we know so far is
New [(a, b)] (Map a b).  In this context, what else could we possibly
have for w besides (Map u v) ?

Cheers,

D. Tenev


More information about the Glasgow-haskell-users mailing list