Rules for class methods and Safe Haskell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Rules for class methods and Safe Haskell

Wolfgang Jeltsch-2
Hi,

the module Control.Arrow declares a set of rules for the Arrow class. It
is marked “Trustworthy”, probably to allow these rules to actually fire.

Now these rules are only correct for class instances that actually
satisfy the arrow laws. If the author of another module defines an
instance of Arrow that does not respect the laws, this other module
could still be considered “Safe” by GHC, although the rules from
Control.Arrow are bogus now.

Is this considered a problem?

All the best,
Wolfgang

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Rules for class methods and Safe Haskell

Wolfgang Jeltsch-2

Am Freitag, den 15.08.2014, 23:10 +0300 schrieb Wolfgang Jeltsch:

> Hi,
>
> the module Control.Arrow declares a set of rules for the Arrow class. It
> is marked “Trustworthy”, probably to allow these rules to actually fire.
>
> Now these rules are only correct for class instances that actually
> satisfy the arrow laws. If the author of another module defines an
> instance of Arrow that does not respect the laws, this other module
> could still be considered “Safe” by GHC, although the rules from
> Control.Arrow are bogus now.
>
> Is this considered a problem?
>
> All the best,
> Wolfgang

Hi,

could someone please answer this e-mail? This issue is important for me.

All the best,
Wolfgang


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: Rules for class methods and Safe Haskell

David Feuer

That's an interesting question. I'm not even close to an expert, but I *think* that parametricity prevents those particular rules from breaking Safe Haskell guarantees. The laws may not *hold* for a broken instance, but I don't *think* that lets you break type safety or IO encapsulation.

On Nov 13, 2014 2:03 PM, "Wolfgang Jeltsch" <[hidden email]> wrote:

Am Freitag, den 15.08.2014, 23:10 +0300 schrieb Wolfgang Jeltsch:
> Hi,
>
> the module Control.Arrow declares a set of rules for the Arrow class. It
> is marked “Trustworthy”, probably to allow these rules to actually fire.
>
> Now these rules are only correct for class instances that actually
> satisfy the arrow laws. If the author of another module defines an
> instance of Arrow that does not respect the laws, this other module
> could still be considered “Safe” by GHC, although the rules from
> Control.Arrow are bogus now.
>
> Is this considered a problem?
>
> All the best,
> Wolfgang

Hi,

could someone please answer this e-mail? This issue is important for me.

All the best,
Wolfgang


_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users