faking universal quantification in constraints
ekmett at gmail.com
Wed Apr 18 01:24:05 CEST 2012
On Tue, Apr 17, 2012 at 6:40 PM, Nicolas Frisby <nicolas.frisby at gmail.com>wrote:
> I built a (really ugly) dictionary for (Int ~ Char) using
> Data.Constraints.Forall. I'm fairly confident it could be generalized
> to a polymorphic coercion (a ~ b).
> I cheated with overlapping instances, but you left me no choice ;).
> Anyone who pulls this kind of stunt is definitely trying to subvert
> it; so I vote "trustworthy".
> I'm adopting Data.Constraints.Forall for my local experimentation.
> Thanks for pointing it out.
With overlapping instances you can build any dictionary you want, even
without unsafeCoerce, so I'll leave it in. ;)
I should probably avoid using (,) as well, to further stymie such efforts.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glasgow-haskell-users