[Haskell-cafe] Any precedent or plan for guaranteed-safe Eq and Ord instances?
Wed Oct 2 13:33:40 UTC 2013
* Tillmann Rendel <rendel at informatik.uni-marburg.de> [2013-10-02 13:19:38+0200]
> Roman Cheplyaka wrote:
> >It still seems to fit nicely into Safe Haskell. If you are the
> >implementor of an abstract type, you can do whatever you want in the Eq
> >instance, declare your module as Trustworthy, and thus take the
> >responsibility for soundness of that instance w.r.t. your public API.
> A possible problem with marking "instance Eq" as an unsafe feature is
> that many modules would be only Trustworthy instead of Safe. So if I
> don't trust the authors of a module (because I don't know them), I
> cannot safely use their code just because they implement their own Eq
> That would go against my "every purely functional module is
> automatically safe because the compiler checks that it cannot launch
> the missiles" understanding of Safe Haskell.
> Actually, Eq instances are not unsafe per se, but only if I also use
> some other module that assumes certain properties about all Eq
> instances in scope. So in order to check safety, two independent
> modules (the provider and the consumer of the Eq instance) would have
> to cooperate.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 836 bytes
Desc: Digital signature
More information about the Haskell-Cafe