Re: [Haskell-cafe] Re: request for code review

2006-03-15 Thread Benjamin Franksen
On Tuesday 14 March 2006 20:58, you wrote: On 3/14/06, Benjamin Franksen [EMAIL PROTECTED] wrote: On Tuesday 14 March 2006 14:46, Pete Chown wrote: Shannon -jj Behrens wrote: Arrows looks like a replacement for monads. Are you saying I should drop my use of the State monad? If so,

Re: [Haskell-cafe] Re: request for code review

2006-03-15 Thread Benjamin Franksen
On Tuesday 14 March 2006 20:58, you wrote: On 3/14/06, Benjamin Franksen [EMAIL PROTECTED] wrote: On Tuesday 14 March 2006 14:46, Pete Chown wrote: Shannon -jj Behrens wrote: Arrows looks like a replacement for monads. Are you saying I should drop my use of the State monad? If so,

Re: [Haskell-cafe] Re: request for code review

2006-03-15 Thread Udo Stenzel
Shannon -jj Behrens wrote: o How important is it that I switch from using the State monad to using arrows? Your problem seems to be naturally soved by the State monad, therefore you should use that. o How important is it that I switch from using | or $ to using arrows? Unimportant.

Re: [Haskell-cafe] Re: request for code review

2006-03-15 Thread Shannon -jj Behrens
Ok, with all the various opinions, I think I'll: o Stick with the State monad. o Switch from | to $ and teach readers how to read it, Think of 'f $ g $ x' as 'f of g of x' or 'f(g(x))'. From that point of view, it may be helpful to read 'f $ g $ x' from right to left. Unless there are any

[Haskell-cafe] Re: request for code review

2006-03-14 Thread Pete Chown
Shannon -jj Behrens wrote: I'm only using | as a replacement for $ because I find it more readable to read left to right than right to left. You can see this in two different ways, I think. Imagine the following: (+1) (*2) 3 This is not legal Haskell because it gets parsed as: ((+1) (*2))

Re: [Haskell-cafe] Re: request for code review

2006-03-14 Thread Benjamin Franksen
On Tuesday 14 March 2006 14:46, Pete Chown wrote: Shannon -jj Behrens wrote: Arrows looks like a replacement for monads. Are you saying I should drop my use of the State monad? If so, why? I like the readability of the do syntax. Okay, now it's my turn to ask a question. :-) I've read

Re: [Haskell-cafe] Re: request for code review

2006-03-14 Thread Shannon -jj Behrens
On 3/14/06, Benjamin Franksen [EMAIL PROTECTED] wrote: On Tuesday 14 March 2006 14:46, Pete Chown wrote: Shannon -jj Behrens wrote: Arrows looks like a replacement for monads. Are you saying I should drop my use of the State monad? If so, why? I like the readability of the do

Re: [Haskell-cafe] Re: request for code review

2006-03-14 Thread Malcolm Wallace
Shannon -jj Behrens [EMAIL PROTECTED] writes: o How important is it that I switch from using the State monad to using arrows? Not at all. o How important is it that I switch from using | or $ to using arrows? Not at all. (It seems that using arrows just to replace | or $ is like

Re: [Haskell-cafe] Re: request for code review

2006-03-14 Thread Neil Mitchell
Hi, I disagree with most people on this, since I am in general principle opposed to monads on the grounds that I don't understand them :) o How important is it that I switch from using the State monad to using arrows? I don't understand either monads or arrows o How important is it that I

[Haskell-cafe] Re: request for code review

2006-03-13 Thread Shannon -jj Behrens
On 3/12/06, Einar Karttunen ekarttun@cs.helsinki.fi wrote: On 12.03 01:47, Shannon -jj Behrens wrote: monad. Perhaps controversially, I've continued to use | in a bunch of places that the monad didn't get rid of because I think it's more readable, but I'm still open for argument on this

Re: [Haskell-cafe] Re: request for code review

2006-03-13 Thread Shannon -jj Behrens
On 3/12/06, Lennart Augustsson [EMAIL PROTECTED] wrote: Shannon -jj Behrens wrote: lexString ('*':cs) = (classifyString *, cs) lexString (c:cs) = (classifyString [c], cs) The first line isn't needed, it does the same as the second line. Good eye! You are correct. Thanks, -jj

Re: [Haskell-cafe] Re: request for code review

2006-03-13 Thread Tomasz Zielonka
On Mon, Mar 13, 2006 at 06:48:51PM -0800, Shannon -jj Behrens wrote: consolidateOutput = output reverse concat and so on. Are you saying that can be used as a reversed version of $? For the (-) instance of Arrow, () is simply reversed function composition, () = flip (.). Using Arrows

[Haskell-cafe] Re: request for code review

2006-03-12 Thread Shannon -jj Behrens
Hi, Thanks to everyone who reviewed my code and submitted comments the first time! I've updated the code and transitioned to using the State monad. Perhaps controversially, I've continued to use | in a bunch of places that the monad didn't get rid of because I think it's more readable, but I'm

[Haskell-cafe] Re: request for code review

2006-03-12 Thread Einar Karttunen
On 12.03 01:47, Shannon -jj Behrens wrote: monad. Perhaps controversially, I've continued to use | in a bunch of places that the monad didn't get rid of because I think it's more readable, but I'm still open for argument on this topic. Using the What about using () from Control.Arrow? --

Re: [Haskell-cafe] Re: request for code review

2006-03-12 Thread Lennart Augustsson
Shannon -jj Behrens wrote: lexString ('*':cs) = (classifyString *, cs) lexString (c:cs) = (classifyString [c], cs) The first line isn't needed, it does the same as the second line. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org