Proposal: Add (<$>) to Prelude as part of the AMP in GHC 7.10-RC3
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door. Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2] Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of foo <$> bar <*> baz <*> quux doesn't work out of the box! I'd like to include (<$>) in the Prelude in RC3. I'd also like to invite discussion about whether folks believe we should include (<$) out of the box. (<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains. Discussion Period: 2 weeks Thank you, -Edward Kmett [1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
+1 on <$> +1 on <$ On Tue Feb 24 2015 at 5:39:56 PM Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
+1 on both On Tue Feb 24 2015 at 10:42:41 AM Michael Snoyman <michael@snoyman.com> wrote:
+1 on <$> +1 on <$
On Tue Feb 24 2015 at 5:39:56 PM Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-1 on both. Leaving them out might encourage people to use "pure foo" or the idiom QuasiQuoter. It's not obvious [to me at least] which of the 3 styles is best, so I'd prefer to keep the additional syntax out of the Prelude. -Greg On Tue, Feb 24, 2015 at 7:43 AM, Alec <alec@deviant-logic.net> wrote:
+1 on both
On Tue Feb 24 2015 at 10:42:41 AM Michael Snoyman <michael@snoyman.com> wrote:
+1 on <$> +1 on <$
On Tue Feb 24 2015 at 5:39:56 PM Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
+1 on <$>. No opinion on <$. Does that mean I can an an extra +1 for <$>? On Feb 24, 2015 10:39 AM, "Edward Kmett" <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
As the results were almost unanimous, we've merged both. [1][2][3] This was mentioned in the GHC Status Update <https://ghc.haskell.org/trac/ghc/blog/weekly20150310> today and they should appear in RC3. -Edward [1] : https://ghc.haskell.org/trac/ghc/ticket/10113 [2] : https://git.haskell.org/ghc.git/commitdiff/eb3661f2b9f8472f3714774126ebe1183... [3] : https://ghc.haskell.org/trac/ghc/changeset/479523f3c37894d63352f1718e06696f3... On Mon, Mar 2, 2015 at 1:01 PM, John Wiegley <johnw@newartisans.com> wrote:
A hearty +1 for both.
John _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
+1 on <$>. Indifferent on <$. -Christopher On Tue, Feb 24 2015, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Christopher Reichert irc: creichert gpg: C81D 18C8 862A 3618 1376 FFA5 6BFC A992 9955 929B
This is a tough call for me. This change will be very annoying, I think. When updating for 7.10, I was quite surprised that I still needed to import Control.Applicative for <$>, and put in the CPP to do so. Now I'll have to remove that from quite a few modules. Given that we plan only a week for RC3, there are a lot of modules in the ecosystem that will have to be updated within that week! Of course, an author who doesn't update (by removing the now-redundant import of <$>) just gets a warning, but it's still annoying. In my opinion, little changes like this, made right before the deadline, make Haskell feel more like a little research language than something meant to support industrial work. All that said, I desperately miss having <$> in the Prelude in 7.10. Hence the tough call. 0 from me, then. Richard On Feb 24, 2015, at 10:47 AM, Christopher Reichert <creichert07@gmail.com> wrote:
+1 on <$>. Indifferent on <$.
-Christopher
On Tue, Feb 24 2015, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Christopher Reichert irc: creichert gpg: C81D 18C8 862A 3618 1376 FFA5 6BFC A992 9955 929B _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
It is clearly sad that we reached that stage before realizing the problem, but OTOH it would be worst to not fix it now that we still have a (very) last chance. +1 on both from me. Unlike Greg I don't think encouraging people to use the QuasiQuoter is a good idea, it's for me obvious that the <$> syntax is widely used, I see it in mostly every open source code I read. On 24 February 2015 at 17:03, Richard Eisenberg <eir@cis.upenn.edu> wrote:
This is a tough call for me.
This change will be very annoying, I think. When updating for 7.10, I was quite surprised that I still needed to import Control.Applicative for <$>, and put in the CPP to do so. Now I'll have to remove that from quite a few modules. Given that we plan only a week for RC3, there are a lot of modules in the ecosystem that will have to be updated within that week!
Of course, an author who doesn't update (by removing the now-redundant import of <$>) just gets a warning, but it's still annoying.
In my opinion, little changes like this, made right before the deadline, make Haskell feel more like a little research language than something meant to support industrial work.
All that said, I desperately miss having <$> in the Prelude in 7.10. Hence the tough call.
0 from me, then.
Richard
On Feb 24, 2015, at 10:47 AM, Christopher Reichert <creichert07@gmail.com> wrote:
+1 on <$>. Indifferent on <$.
-Christopher
On Tue, Feb 24 2015, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have
found
some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Christopher Reichert irc: creichert gpg: C81D 18C8 862A 3618 1376 FFA5 6BFC A992 9955 929B _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- *Λ\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard
Very +1 from me. On 24 Feb 2015 16:08, "Alois Cochard" <alois.cochard@gmail.com> wrote:
It is clearly sad that we reached that stage before realizing the problem, but OTOH it would be worst to not fix it now that we still have a (very) last chance.
+1 on both from me.
Unlike Greg I don't think encouraging people to use the QuasiQuoter is a good idea, it's for me obvious that the <$> syntax is widely used, I see it in mostly every open source code I read.
On 24 February 2015 at 17:03, Richard Eisenberg <eir@cis.upenn.edu> wrote:
This is a tough call for me.
This change will be very annoying, I think. When updating for 7.10, I was quite surprised that I still needed to import Control.Applicative for <$>, and put in the CPP to do so. Now I'll have to remove that from quite a few modules. Given that we plan only a week for RC3, there are a lot of modules in the ecosystem that will have to be updated within that week!
Of course, an author who doesn't update (by removing the now-redundant import of <$>) just gets a warning, but it's still annoying.
In my opinion, little changes like this, made right before the deadline, make Haskell feel more like a little research language than something meant to support industrial work.
All that said, I desperately miss having <$> in the Prelude in 7.10. Hence the tough call.
0 from me, then.
Richard
On Feb 24, 2015, at 10:47 AM, Christopher Reichert <creichert07@gmail.com> wrote:
+1 on <$>. Indifferent on <$.
-Christopher
On Tue, Feb 24 2015, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC
7.10
goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Christopher Reichert irc: creichert gpg: C81D 18C8 862A 3618 1376 FFA5 6BFC A992 9955 929B _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- *Λ\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
This one draws me out of silence. Strong +1 on (<$>). 0 on (<$). — Sent from Mailbox On Tue, Feb 24, 2015 at 11:08 AM, Alois Cochard <alois.cochard@gmail.com> wrote:
It is clearly sad that we reached that stage before realizing the problem, but OTOH it would be worst to not fix it now that we still have a (very) last chance. +1 on both from me. Unlike Greg I don't think encouraging people to use the QuasiQuoter is a good idea, it's for me obvious that the <$> syntax is widely used, I see it in mostly every open source code I read. On 24 February 2015 at 17:03, Richard Eisenberg <eir@cis.upenn.edu> wrote:
This is a tough call for me.
This change will be very annoying, I think. When updating for 7.10, I was quite surprised that I still needed to import Control.Applicative for <$>, and put in the CPP to do so. Now I'll have to remove that from quite a few modules. Given that we plan only a week for RC3, there are a lot of modules in the ecosystem that will have to be updated within that week!
Of course, an author who doesn't update (by removing the now-redundant import of <$>) just gets a warning, but it's still annoying.
In my opinion, little changes like this, made right before the deadline, make Haskell feel more like a little research language than something meant to support industrial work.
All that said, I desperately miss having <$> in the Prelude in 7.10. Hence the tough call.
0 from me, then.
Richard
On Feb 24, 2015, at 10:47 AM, Christopher Reichert <creichert07@gmail.com> wrote:
+1 on <$>. Indifferent on <$.
-Christopher
On Tue, Feb 24 2015, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have
found
some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Christopher Reichert irc: creichert gpg: C81D 18C8 862A 3618 1376 FFA5 6BFC A992 9955 929B _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- *Λ\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard
Hi, Am Dienstag, den 24.02.2015, 10:39 -0500 schrieb Edward Kmett:
I'd like to include (<$>) in the Prelude in RC3.
+1
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
not sure that it’s worth having it in the Prelude. So my default for changes that I’m not convinced about (especially if they affect the Prelude): -1 Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org
On 2015-02-24 at 16:39:51 +0100, Edward Kmett wrote: [...]
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
+1 for <$> +0.99999... for <$ PS: ...and there's also a ticket for this at https://ghc.haskell.org/trac/ghc/ticket/10113 The linked Phabricator code-revision D680 currently just re-exports (<$>), I'll soon create a 2nd one which also exports (<$) Cheers, hvr
(+1) to both. On 2015-02-24 16:39, Edward Kmett wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
+1 to both. It would be very sad to go through all these hurdles and not to have a consistent story in the end. On 24/02/15 17:39, Edward Kmett wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
On 24-02-2015 16:39, Edward Kmett wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
+1 on (<$>) 0 on (<$) ... but I must say that I've never actually seen the later in any code I've inspected. (But then I'm usually not looking at that much high-level applicative code, code, so...)
Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
If <*> is in Prelude (I'm unclear) then I'm +1 on getting <$> there too - <*> is practically useless without <$>! <$ is handy and I do tend to use it, but I don't feel so strongly about having that in the Prelude (so I'm not going to vote for or against that). - Ollie
+1 for me on both. Besides convenience, symmetry is important so we should export <$> if we export <*> and <$ if <*. On Feb 24, 2015 9:33 AM, "Oliver Charles" <ollie@ocharles.org.uk> wrote:
If <*> is in Prelude (I'm unclear) then I'm +1 on getting <$> there too - <*> is practically useless without <$>!
<$ is handy and I do tend to use it, but I don't feel so strongly about having that in the Prelude (so I'm not going to vote for or against that).
- Ollie
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
On 24 Feb 2015, at 15:39, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
For more on this idiom (indeed), let me shamelessly plug http://stackoverflow.com/a/15124278/828361 and advise that the two travel together. I won’t vote. While we are still in the situation that progress breaks code which has been engineered to work around the prior lack of progress, making progress is simultaneously a good and bad idea. We should think about how to adapt our language of imports to accept the only too obvious reality that libraries change over time, so that we might be allowed to program defensively against sudden outbreaks of common sense. Apologetically Conor
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
+1 for <$>, 0 on <$, I rarely use it. On Tue, Feb 24, 2015 at 7:25 PM, Conor McBride <conor@strictlypositive.org> wrote:
On 24 Feb 2015, at 15:39, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
For more on this idiom (indeed), let me shamelessly plug
http://stackoverflow.com/a/15124278/828361
and advise that the two travel together.
I won’t vote. While we are still in the situation that progress breaks code which has been engineered to work around the prior lack of progress, making progress is simultaneously a good and bad idea. We should think about how to adapt our language of imports to accept the only too obvious reality that libraries change over time, so that we might be allowed to program defensively against sudden outbreaks of common sense.
Apologetically
Conor
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1]
http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/
[2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Hi all, +1 on both <$> and <$ . Cheers, Milan Straka
-----Original message----- From: Edward Kmett <ekmett@gmail.com> Sent: 24 Feb 2015, 10:39
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
+1 to <$>. To me, Applicative means pure/<$>/<*>. Having 2/3rds of that in the Prelude seems weird. If we hadn't put things like *> in the Prelude, then I'd vote -1 for <$. But given the Prelude operator creep has begun, I can see why <$ lives on the other side of the line, given if I'm not particularly in favor of where the line lies. Thanks, Neil On Tue, Feb 24, 2015 at 7:06 PM, Milan Straka <fox@ucw.cz> wrote:
Hi all,
+1 on both <$> and <$ .
Cheers, Milan Straka
-----Original message----- From: Edward Kmett <ekmett@gmail.com> Sent: 24 Feb 2015, 10:39
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
On 24.02.2015 20:06, Milan Straka wrote:
+1 on both <$> and <$ .
Same here. --Andreas
-----Original message----- From: Edward Kmett <ekmett@gmail.com> Sent: 24 Feb 2015, 10:39
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel@gu.se http://www2.tcs.ifi.lmu.de/~abel/
Hi, Big +1 for both from me. --Kazu From: Edward Kmett <ekmett@gmail.com> Subject: Proposal: Add (<$>) to Prelude as part of the AMP in GHC 7.10-RC3
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
Just to show my ignorance about the internals of the GHC development process. Suppose I might want to take a look at the new Prelude in order to form an opinion and probably express it, where can I find it? I see a lot of talking about it, but I do not see a link anywhere. Doaitse
On 25 Feb 2015, at 11:22 , Phil Ruffwind <rf@rufflewind.com> wrote:
(+2) on both _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
You can clone the official git repository: https://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources You can also browse the official git repository using a somewhat awkward interface, but it's probably easier to browse the official mirror: https://github.com/ghc/ghc On Wed, Feb 25, 2015 at 10:29 AM, S. Doaitse Swierstra <doaitse@swierstra.net> wrote:
Just to show my ignorance about the internals of the GHC development process.
Suppose I might want to take a look at the new Prelude in order to form an opinion and probably express it, where can I find it? I see a lot of talking about it, but I do not see a link anywhere.
Doaitse
On 25 Feb 2015, at 11:22 , Phil Ruffwind <rf@rufflewind.com> wrote:
(+2) on both _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Hi Doaitse, Here you go: https://github.com/ghc/ghc/blob/master/libraries/base/Prelude.hs On 25/02/15 17:29, S. Doaitse Swierstra wrote:
Just to show my ignorance about the internals of the GHC development process.
Suppose I might want to take a look at the new Prelude in order to form an opinion and probably express it, where can I find it? I see a lot of talking about it, but I do not see a link anywhere.
Doaitse
Here it is: https://github.com/ghc/ghc/blob/master/libraries/base/Prelude.hs On 25 February 2015 at 16:29, S. Doaitse Swierstra <doaitse@swierstra.net> wrote:
Just to show my ignorance about the internals of the GHC development process.
Suppose I might want to take a look at the new Prelude in order to form an opinion and probably express it, where can I find it? I see a lot of talking about it, but I do not see a link anywhere.
Doaitse
On 25 Feb 2015, at 11:22 , Phil Ruffwind <rf@rufflewind.com> wrote:
(+2) on both _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- *Λ\ois* http://twitter.com/aloiscochard http://github.com/aloiscochard
Hi, Am Mittwoch, den 25.02.2015, 16:29 +0100 schrieb S. Doaitse Swierstra:
Just to show my ignorance about the internals of the GHC development process.
Suppose I might want to take a look at the new Prelude in order to form an opinion and probably express it, where can I find it? I see a lot of talking about it, but I do not see a link anywhere.
if you prefer haddock, see http://haskell.inf.elte.hu/docs/latest/html/libraries/base-4.8.0.0/Prelude.h... for the state of GHC HEAD (which might deviate from 7.10 though) Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org
You can browse through the haddocks for the previous release candidate here: http://hackage.haskell.org/package/base-4.8.0.0/candidate/docs/Prelude.html On Wed, Feb 25, 2015 at 10:29 AM, S. Doaitse Swierstra < doaitse@swierstra.net> wrote:
Just to show my ignorance about the internals of the GHC development process.
Suppose I might want to take a look at the new Prelude in order to form an opinion and probably express it, where can I find it? I see a lot of talking about it, but I do not see a link anywhere.
Doaitse
On 25 Feb 2015, at 11:22 , Phil Ruffwind <rf@rufflewind.com> wrote:
(+2) on both _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Edward Kmett wrote:
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
+1 for both from me. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
(<$>): +1 (<$): +1 On Tue, Feb 24, 2015 at 7:39 AM, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
+1 both Dne út 24. 2. 2015 16:39 uživatel Edward Kmett <ekmett@gmail.com> napsal:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Those operators are for Power Users - why put them in the Prelude? I mean, they are so money, I can't find words to describe them. Below are a few attempts. I start with a description in English, then implement using Functor's bling operators, and then again using the Prelude as-is. In each case, the code is shorter with the bling operators, but if you try to verbalize it, it's nonsense and the syntax is ungoogleable. import Data.Functor((<$>), (<$), ($>)) -- Map (+1) on a computation moneyCentric, moneyCentric2 :: IO Int moneyCentric = (+1) <$> return 1 moneyCentric2 = fmap (+1) $ return 1 -- Map (const 2) on a computation lessMoney, lessMoney2 :: IO Int lessMoney = 2 <$ return 1 lessMoney2 = fmap (const 2) $ return 1 -- Run a computation, but then return 2. moneyGreaterThan, moneyGreaterThan2 :: IO Int moneyGreaterThan = return 1 $> 2 moneyGreaterThan2 = return 1 `butReturn` 2 where m `butReturn` x = m >> return x And check this out: Prelude> 2 <$ return 1 <interactive>:2:3: Not in scope: ‘<$’ Perhaps you meant one of these: ‘<’ (imported from Prelude), ‘<=’ (imported from Prelude), ‘$’ (imported from Prelude) The syntax '<$' is close enough to '<=' and '$' that ghci guesses it was a typo. Shouldn't we assume this syntax would make a beginner's head spin? If you really want to use those operators, import Data.Functor. Why must it be in the Prelude? -Greg
Dne út 24. 2. 2015 16:39 uživatel Edward Kmett <ekmett@gmail.com> napsal:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
On Thu, Feb 26, 2015 at 6:37 PM, Greg Fitzgerald <garious@gmail.com> wrote:
Those operators are for Power Users - why put them in the Prelude?
.. because without them that whole Applicative thing that we're bringing in as a superclass of Monad with the AMP is cut off at the knees. Applicative sugar is typically used like both f (x,y) = (,) <$> x <*> y or traverse f (x:xs) = (:) <$> f x <*> traverse f xs traverse f [] = pure [] Without (<$>), (<*>) from Applicative is quite difficult to use. both f (x,y) = pure (,) <*> x <*> y is much less efficient and both f (x,y) = fmap (,) x <*> y is painfully far from idiomatic. -Edward -Greg
Dne út 24. 2. 2015 16:39 uživatel Edward Kmett <ekmett@gmail.com> napsal:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have
found
some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
They definitely should be in both, since the default implementations of <$> and <$ f <$> x = pure f <*> x f <$ x = const f <*> x may be less efficient than a special implementation having more knowledge about applicative. Doaitse PS: for that reason they are for almost 20 years now member of the class IsParser in http://hackage.haskell.org/package/uulib-0.9.16/docs/UU-Parsing-Interface.ht... <http://hackage.haskell.org/package/uulib-0.9.16/docs/UU-Parsing-Interface.html> , which inspired the introduction of Applicative and Alternative in the first place.
On 27 Feb 2015, at 5:45 , Edward Kmett <ekmett@gmail.com> wrote:
On Thu, Feb 26, 2015 at 6:37 PM, Greg Fitzgerald <garious@gmail.com <mailto:garious@gmail.com>> wrote: Those operators are for Power Users - why put them in the Prelude?
.. because without them that whole Applicative thing that we're bringing in as a superclass of Monad with the AMP is cut off at the knees.
Applicative sugar is typically used like
both f (x,y) = (,) <$> x <*> y
or
traverse f (x:xs) = (:) <$> f x <*> traverse f xs traverse f [] = pure []
Without (<$>), (<*>) from Applicative is quite difficult to use.
both f (x,y) = pure (,) <*> x <*> y
is much less efficient and
both f (x,y) = fmap (,) x <*> y
is painfully far from idiomatic.
-Edward
-Greg
Dne út 24. 2. 2015 16:39 uživatel Edward Kmett <ekmett@gmail.com <mailto:ekmett@gmail.com>> napsal:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ <http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/> [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp <https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp> _______________________________________________ Libraries mailing list Libraries@haskell.org <mailto:Libraries@haskell.org> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries <http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries>
_______________________________________________ Libraries mailing list Libraries@haskell.org <mailto:Libraries@haskell.org> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries <http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries>
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Definitely +1 on <$>. +0.5 on <$, I suspect this one being in the Prelude or not isn't as big a deal as for <$>. On Fri, Feb 27, 2015 at 9:58 AM, S. Doaitse Swierstra <doaitse@swierstra.net
wrote:
They definitely should be in both, since the default implementations of <$> and <$
f <$> x = pure f <*> x f <$ x = const f <*> x
may be less efficient than a special implementation having more knowledge about applicative.
Doaitse
PS: for that reason they are for almost 20 years now member of the class IsParser in http://hackage.haskell.org/package/uulib-0.9.16/docs/UU-Parsing-Interface.ht... , which inspired the introduction of Applicative and Alternative in the first place.
On 27 Feb 2015, at 5:45 , Edward Kmett <ekmett@gmail.com> wrote:
On Thu, Feb 26, 2015 at 6:37 PM, Greg Fitzgerald <garious@gmail.com> wrote:
Those operators are for Power Users - why put them in the Prelude?
.. because without them that whole Applicative thing that we're bringing in as a superclass of Monad with the AMP is cut off at the knees.
Applicative sugar is typically used like
both f (x,y) = (,) <$> x <*> y
or
traverse f (x:xs) = (:) <$> f x <*> traverse f xs traverse f [] = pure []
Without (<$>), (<*>) from Applicative is quite difficult to use.
both f (x,y) = pure (,) <*> x <*> y
is much less efficient and
both f (x,y) = fmap (,) x <*> y
is painfully far from idiomatic.
-Edward
-Greg
Dne út 24. 2. 2015 16:39 uživatel Edward Kmett <ekmett@gmail.com> napsal:
We have a couple of weeks until the third release candidate for GHC
7.10
goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1]
http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/
[2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Alp Mestanogullari
That is not and was never the motivation of FTP. FTP was about not wanting to have to hide a zillion functions from Prelude, Data.List, Control.Applicative, and Control.Monad. Functors are utterly ubiquitous in Haskell programming, so adding an operator to make them easier to use seems quite sensible. On Feb 27, 2015 12:19 PM, "Henning Thielemann" < lemming@henning-thielemann.de> wrote:
On Thu, 26 Feb 2015, Greg Fitzgerald wrote:
If you really want to use those operators, import Data.Functor. Why
must it be in the Prelude?
It seems that many Haskell programmers don't like to write "import". That's the whole motivation for FTP. I can't understand it, too. _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
On Fri, 27 Feb 2015, David Feuer wrote:
That is not and was never the motivation of FTP. FTP was about not wanting to have to hide a zillion functions from Prelude, Data.List, Control.Applicative, and Control.Monad. Functors are utterly ubiquitous in Haskell programming, so adding an operator to make them easier to use seems quite sensible.
I always import Foldable, Traversable, Data.List with qualification. No need to hide something.
+1 On Tue, Feb 24, 2015 at 10:39:51AM -0500, Edward Kmett wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
+1 to both. On 24 February 2015 at 16:39, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
(<$) has been a member of Functor for a long time, which is only visible if you import it from Data.Functor or bring in Control.Applicative. There is an idiom that you use (<*) and (<$) to point to the parts of the structure that you want to keep the answers from when building longer such Applicative chains.
Discussion Period: 2 weeks
Thank you, -Edward Kmett
[1] http://www.reddit.com/r/haskell/comments/2wzixa/shouldnt_be_in_prelude/ [2] https://plus.google.com/115504368969270249241/posts/URzeDWd7qMp
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
On Tue, Feb 24, 2015 at 10:39 AM, Edward Kmett <ekmett@gmail.com> wrote:
We have a couple of weeks until the third release candidate for GHC 7.10 goes out the door.
Along the way with the last couple of release candidates folks have found some problems with the way we implemented the AMP. [1][2]
Most notably, we failed to include (<$>) in the Prelude, so the standard idiom of
foo <$> bar <*> baz <*> quux
doesn't work out of the box!
I'd like to include (<$>) in the Prelude in RC3.
I'd also like to invite discussion about whether folks believe we should include (<$) out of the box.
Strong +1 for (<$>). I often use (<$>) for non-applicative functors whenever it helps reduce clutter. As far as the comment about encouraging people to use pure, the whole point of (<$>) being an alias for fmap is that (f <$> x) can be a significant optimization over (pure f <*> x). Ambivalent about (<$) -- Live well, ~wren
participants (39)
-
Adam Bergmark -
Alec -
Alois Cochard -
Alp Mestanogullari -
Andreas Abel -
Bardur Arantsson -
Bas van Dijk -
Christopher Reichert -
Conal Elliott -
Conor McBride -
David Feuer -
Dominique Devriese -
Edward Kmett -
Elliot Robinson -
Erik de Castro Lopo -
Fumiaki Kinoshita -
Greg Fitzgerald -
Gregory Collins -
Henning Thielemann -
Herbert Valerio Riedel -
Joachim Breitner -
John Wiegley -
Joseph Abrahamson -
Kazu Yamamoto -
Mario Blažević -
Michael Snoyman -
Milan Straka -
Nathan van Doorn -
Neil Mitchell -
Oliver Charles -
Petr Pudlák -
Phil Ruffwind -
Richard Eisenberg -
Roman Cheplyaka -
S. Doaitse Swierstra -
Simon Hengel -
Tikhon Jelvis -
Twan van Laarhoven -
wren romano