[Haskell-cafe] Fixing undeduceable instance ==> overlapping instance

Karl Voelker ktvoelker at gmail.com
Sun Feb 24 08:14:27 CET 2013


On Sat, Feb 23, 2013 at 10:28 PM, Michael Orlitzky <michael at orlitzky.com>wrote:

>   -- Recursive case, (n+2) x (n+2) matrices.
>   instance (Eq a, Ring.C a, Arity n)
>          => Determined (Mat (S (S n)) (S (S n))) a where
>   determinant m =
>     ...
>     -- Recursive algorithm, the i,jth minor has dimension
>     -- (n+1) x (n+1).
>     foo bar (determinant (minor m i j))
>
> I get an error stating that I'm missing an instance:
>
>   Could not deduce (Determined (Mat (S n) (S n)) a)
>   ...
>

It looks to me like you just need to add (Determined (Mat (S n) (S n)) a)
into the context of this instance. The problem is that the type variable
"n" could be almost anything (at least as far as this instance definition
knows).

-Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130223/e40227c2/attachment.htm>


More information about the Haskell-Cafe mailing list