
Hmm, perhaps what we need is another monad tutorial that.....err...never
mind. Actually, I'd like to see more written about Applicatives. I think
they just finally clicked with me when reading the Typeclassopedia, and
seeing the intended way to use them. Before it was always like "ok...so, if
I've got a function already in my functor, I could use this, but...why would
I have that?"
On Thu, Mar 12, 2009 at 10:28 AM, Thomas Davie
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, parsec is a wonderful example of this. When the applicative instance is used instead of the monadic one, programs rapidly become more readable, because they stop describing the order in which things should be parsed, and start 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 writing imperative code in Haskell, it's an excellent imperative language. However, 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 on most of the benefits of doing so.
Hope that clarifies what I meant :)
Bob