Ghc can't assume "in this context" - the object file produced by compilation could be linked into code that provides other instances.
Abe On 5/31/05, Dinko Tenev <[EMAIL PROTECTED]> wrote: > On 5/31/05, robert dockins <[EMAIL PROTECTED]> 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 > _______________________________________________ > Glasgow-haskell-users mailing list > Glasgow-haskell-users@haskell.org > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users > _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users