faking universal quantification in constraints

Edward Kmett 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).
>
>  http://hpaste.org/67180
>
> 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.
;P

-Edward
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20120417/36223fdb/attachment.htm>


More information about the Glasgow-haskell-users mailing list