[<<][meta_siso][>>][..]
Fri Jul 31 00:52:58 EDT 2015

weird error

Why is this duplicate?

    Duplicate instance declarations:
      instance (Vec v, TypeOf t) => TypeOf (v t)
        -- Defined at Vec.hs:26:10
      instance (Repr r, TypeOf t) => TypeOf (r t) -- Defined in `Data'


Instantiation is not search! [1]

instance (Repr r, TypeOf t) => TypeOf (r t) where
  typeOf _ = typeOf $ unRepr (undefined :: r t)


Above, (r t) is very generic.  The compiler will match that to
anything and then add constraints.  It won't pick an instance based on
constraints satisfied.

Essentially, instance resolution is quite "dumb".

[1] https://mail.haskell.org/pipermail/haskell-cafe/2008-October/049777.html





[Reply][About]
[<<][meta_siso][>>][..]