[Haskell-cafe] Functional dependencies and incoherent instances
emax at chalmers.se
Wed Oct 8 13:16:25 EDT 2008
I think the technique described at
may give you what you want. I've never tried it myself though.
Tobias Bexelius skrev:
> Yeah, I realized that.
> But heres where I would like the undecidable incoherent instances to kick in, i.e. as long as I haven't got any NumVec instances GHC should be able to choose only one of the Mult instances. Or do I have too much faith in the -fallow-incoherent-instances flag now? :/
> I would like to be able to write something like
>> instance (Vec a x, -Num (a x)) => Mult (a x) (a x) x where (*.) = dot
> where -Num (a x) means that (a x) must not be an instance of Num. Can I express this in some way?
More information about the Haskell-Cafe