This is the only possible definition...so it should exist instance Alternative Proxy where empty = Proxy _ <|> _ Proxy
+1. I see no problem here. On Wed, Mar 9, 2016 at 5:49 PM, Fumiaki Kinoshita <fumiexcel@gmail.com> wrote:
This is the only possible definition...so it should exist
instance Alternative Proxy where empty = Proxy _ <|> _ Proxy
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
El 9 mar 2016, a las 17:49, Fumiaki Kinoshita <fumiexcel@gmail.com> escribió:
This is the only possible definition...so it should exist
Although I have nothing particularly against an Alternative instance for Proxy, I'd like to say I think "this is the only possible definition, so it should exist" is a nonsequitur. If (again, not specifically speaking about "instance Alternative Proxy" here) there is an instance method with no likely practical use, the fact that the compiler yells when you use it is a *feature*. Tom
instance Alternative Proxy where empty = Proxy _ <|> _ Proxy _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Thinking an instance non-practical does not imply we *never* use the instance. The lack of a uniquely legal instance turns out to be a problem at some point, maybe right now.
My point is that there's a cost to adding instances -- namely that accidental calling of the class functions (e.g. after refactoring) isn't caught by the compiler. Since there's a cost, we need to make sure there's a larger benefit before we add them -- e.g. a hypothetical or real use-case. Tom
El 9 mar 2016, a las 20:28, Fumiaki Kinoshita <fumiexcel@gmail.com> escribió:
Thinking an instance non-practical does not imply we *never* use the instance. The lack of a uniquely legal instance turns out to be a problem at some point, maybe right now.
There's a cost to __not__ adding instances as well, namely that accidental need of the class functions (e.g. after abstraction) doesn't fit the library. Since there's a cost, we need to make sure there's a larger benefit before we decide not to add them -- e.g. a hypothetical or real risk. 2016-03-09 18:12 GMT-08:00 <amindfv@gmail.com>:
My point is that there's a cost to adding instances -- namely that accidental calling of the class functions (e.g. after refactoring) isn't caught by the compiler.
Since there's a cost, we need to make sure there's a larger benefit before we add them -- e.g. a hypothetical or real use-case.
Tom
El 9 mar 2016, a las 20:28, Fumiaki Kinoshita <fumiexcel@gmail.com> escribió:
Thinking an instance non-practical does not imply we *never* use the instance. The lack of a uniquely legal instance turns out to be a problem at some point, maybe right now.
We actually already put in a patch for this about 10 days ago, when the discussion came up around U1: https://ghc.haskell.org/trac/ghc/ticket/11650 -Edward On Wed, Mar 9, 2016 at 5:49 PM, Fumiaki Kinoshita <fumiexcel@gmail.com> wrote:
This is the only possible definition...so it should exist
instance Alternative Proxy where empty = Proxy _ <|> _ Proxy
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
participants (4)
-
amindfv@gmail.com -
David Feuer -
Edward Kmett -
Fumiaki Kinoshita