[Haskell-cafe] Abuse of the monad [was: monadic logo]
wagner.andrew at gmail.com
Thu Mar 12 11:36:46 EDT 2009
I was thinking the same thing. If I remember correctly, RWH does a parser in
an applicative style, but I'll have to look when I get home to be sure. If
so, then maybe we could try doing the same thing in a monadic style, for
comparison and contrast purposes.
On Thu, Mar 12, 2009 at 11:29 AM, Jeff Heard <jefferson.r.heard at gmail.com>wrote:
> Come to think of it, I've never seen an applicative tutorial of
> Parsec, only a monadic one. Does such a beast exist, and if so, maybe
> we could merge the two together, work the same example in both, and
> thus help the programmer make the shift from monadic to applicative,
> from order of parsing to describing the grammar.
> -- Jeff
> 2009/3/12 Conal Elliott <conal at conal.net>:
> > Thank you Bob! I'll throw in another 2 cents:
> > Yes, *one* aspect of Haskell is that it's a power tool for imperative
> > programming -- a clever way to keep plugging away at the old sequential
> > Neumann paradigm. C++++.
> > I'd rather we strongly encourage Haskell-newbies toward shifting out of
> > imperative paradigm to thinking and programming *functionally*. It's a
> > shift, to make, and imperative-Haskell is a relatively easy substitute.
> > - Conal
> > On Thu, Mar 12, 2009 at 7:28 AM, Thomas Davie <tom.davie at gmail.com>
> >> On 12 Mar 2009, at 15:16, Andrew Wagner wrote:
> >>> Can you expand on this a bit? I'm curious why you think this.
> >> For two reasons:
> >> Firstly, I often find that people use the Monadic interface when one of
> >> the less powerful ones is both powerful enough and more convenient,
> >> is a wonderful example of this. When the applicative instance is used
> >> instead of the monadic one, programs rapidly become more readable,
> >> they stop describing the order in which things should be parsed, and
> >> describing the grammar of the language being parsed instead.
> >> Secondly, It seems relatively common now for beginners to be told about
> >> the IO monad, and start writing imperative code in it, and thinking that
> >> this is what Haskell programming is. I have no problem with people
> >> imperative code in Haskell, it's an excellent imperative language.
> >> beginners seeing this, and picking it up is usually counter productive –
> >> they never learn how to write things in a functional way, and miss out
> >> most of the benefits of doing so.
> >> Hope that clarifies what I meant :)
> >> Bob_______________________________________________
> >> Haskell-Cafe mailing list
> >> Haskell-Cafe at haskell.org
> >> http://www.haskell.org/mailman/listinfo/haskell-cafe
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe