[Haskell-cafe] Re: request for code review
Shannon -jj Behrens
jjinux at gmail.com
Wed Mar 15 14:07:39 EST 2006
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 objections, with that one change, I'll consider
the coding done and move on to writing the article.
Thanks so much for all of your various opinions and suggestions! I
feel much more comfortable speaking from a position of authority
knowing that all of you have reviewed my code!
On 3/15/06, Udo Stenzel <u.stenzel at web.de> wrote:
> 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. However, I'd recommend switching from application ($,|>) to
> composition (.,>>>) where possible. It's "more functional" and often
> easier to read.
> > o How much will this increase the "conceptual complexity" of my
> > program
> Not at all. You might define >>> locally as
> f >>> g = \x -> g (f x)
> or just pretend that this definition is contained in Control.Arrow due
> to a historical accident, thereby completely ignoring the existence of
> other arrows.
> Wo die Macht geistlos ist, ist der Geist machtlos.
> (aus einem Gipfelbuch)
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (GNU/Linux)
> -----END PGP SIGNATURE-----
More information about the Haskell-Cafe