RE: [Haskell] confusing language in report and a bug in (ghc|hugs)
I'm inclined to think John is right, thought the Report could be clearer. I'll open a GHC sourceforge bug for this. Simon | -----Original Message----- | From: haskell-bounces@haskell.org [mailto:haskell-bounces@haskell.org] On Behalf Of John Peterson | Sent: 29 July 2004 03:36 | To: haskell@haskell.org | Subject: Re: [Haskell] confusing language in report and a bug in (ghc|hugs) | | The intention in the report was to match in the order listed in the | pattern - you need not consult the data declaration to understand the | ordering. I think the report is clear enough - it's just a bug in | ghc. | | John | _______________________________________________ | Haskell mailing list | Haskell@haskell.org | http://www.haskell.org/mailman/listinfo/haskell
On Thu, Jul 29, 2004 at 09:06:05AM +0100, Simon Peyton-Jones wrote:
I'm inclined to think John is right, thought the Report could be clearer.
Yeah, I agree that is the right behavior, the main reason for confusion was the (para)phrase(d) 'just like normal matching except', as my first thought was that just like normal matching implied 'left-to-right' as written in the pattern and that is what the exception is refering too. in any case, the errata makes it quite clear. The bug in ghc didn't help my understanding though :) Also, another small bug in the report: in chapter 4, the fixity table is refered to as table 4.1 in the text, but is labeled 'table 2'. It is also missing the (=<<) operator which is defined in the prelude. out of curiosity, when is the =<< useful? I have never used it and I am wondering if it could have been making my life easier. Perhaps I have just not been trained to recognize when it should be used. It is amazing what little things you pick up when you sit down and read the report as if it were a novel :) John -- John Meacham - ⑆repetae.net⑆john⑈
John Meacham <john@repetae.net> writes:
Also, another small bug in the report:
in chapter 4, the fixity table is refered to as table 4.1 in the text, but is labeled 'table 2'. It is also missing the (=<<) operator which is defined in the prelude.
Thanks, noted in the errata. (However, the table is only misnumbered in the HTML version, not in the PS or PDF versions.) Regards, Malcolm
At 12:49 29/07/04 -0700, John Meacham wrote:
out of curiosity, when is the =<< useful? I have never used it and I am wondering if it could have been making my life easier. Perhaps I have just not been trained to recognize when it should be used.
I don't know if this counts as "useful", but I think it works as the monadic variant of function composition. #g ------------ Graham Klyne For email: http://www.ninebynine.org/#Contact
It works really well stylistically inside the do notation: x <- f =<< xs where you can view this as a process whereby each of the things in the monadic container xs has f applied to it, and each result obtained from that is then bound to x, so the data flows naturally. - Cale Gibbard On Mon, 02 Aug 2004 18:27:12 +0100, Graham Klyne <gk@ninebynine.org> wrote:
At 12:49 29/07/04 -0700, John Meacham wrote:
out of curiosity, when is the =<< useful? I have never used it and I am wondering if it could have been making my life easier. Perhaps I have just not been trained to recognize when it should be used.
I don't know if this counts as "useful", but I think it works as the monadic variant of function composition.
#g
------------ Graham Klyne For email: http://www.ninebynine.org/#Contact
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
participants (5)
-
Cale Gibbard -
Graham Klyne -
John Meacham -
Malcolm Wallace -
Simon Peyton-Jones