Re: [Haskell-cafe] Abuse of the monad [was: monadic logo]

Can you expand on this a bit? I'm curious why you think this.
On Thu, Mar 12, 2009 at 10:13 AM, Thomas Davie
On 12 Mar 2009, at 15:04, Gregg Reynolds wrote:
At risk of becoming the most hated man in all Haskelldom, I'd like to
suggest that the Haskell logo not use lambda symbols. Or at least not as the central element. Sorry, I know I'm late to the party, but the thing is there is nothing distinctive about lambda; it's common to all FPLs. Besides, Lisp/Scheme already have that franchise.
What is distinctive about Haskell it's use of the monad. The Pythagorean monad symbol is wonderfully simple:
No, what's distinctive about Haskell is usually the abuse of the monad.
Encouraging people to think Haskell is all about monadic programming even more is a recipe for disaster.
Just my 2¢
Bob_______________________________________________
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

"Thomas" == Thomas Davie
writes:
Thomas> On 12 Mar 2009, at 15:16, Andrew Wagner wrote:
Can you expand on this a bit? I'm curious why you think this.
Thomas> For two reasons: Thomas> Firstly, I often find that people use the Monadic Thomas> interface when one of the less powerful ones is both Thomas> powerful enough and more convenient, parsec is a wonderful Thomas> example of this. When the applicative instance is used Thomas> instead of the monadic one, programs rapidly become more Thomas> readable, because they stop describing the order in which Thomas> things should be parsed, and start describing the grammar Thomas> of the language being parsed instead. That's interesting. I recently used parsec 3. I wrote using the monadic interface because I could understand (just about) how to do so. I was looking at the examples in RWH, and I could follow the explanation of the monadic interface much easier. Perhaps this was because RWH shows how to write using the monadic interface, and then shows how to convert this to the applicative interface. It's hard to follow a tutorial that shows you how to convert from something you aren't starting with. -- Colin Adams Preston Lancashire

On 12 Mar 2009, at 15:33, Colin Paul Adams wrote:
"Thomas" == Thomas Davie
writes: Thomas> On 12 Mar 2009, at 15:16, Andrew Wagner wrote:
Can you expand on this a bit? I'm curious why you think this.
Thomas> For two reasons:
Thomas> Firstly, I often find that people use the Monadic Thomas> interface when one of the less powerful ones is both Thomas> powerful enough and more convenient, parsec is a wonderful Thomas> example of this. When the applicative instance is used Thomas> instead of the monadic one, programs rapidly become more Thomas> readable, because they stop describing the order in which Thomas> things should be parsed, and start describing the grammar Thomas> of the language being parsed instead.
That's interesting.
I recently used parsec 3. I wrote using the monadic interface because I could understand (just about) how to do so. I was looking at the examples in RWH, and I could follow the explanation of the monadic interface much easier. Perhaps this was because RWH shows how to write using the monadic interface, and then shows how to convert this to the applicative interface. It's hard to follow a tutorial that shows you how to convert from something you aren't starting with.
I suspect that this is an interesting corner case of both my two reasons – firstly, Monads are too powerful here, and secondly, you perhaps found it easier to think about the operational aspects of the parser than to think about the denotation of what the parser should parse. Is that somewhere accurate? Bob

That's interesting.
I recently used parsec 3. I wrote using the monadic interface because I could understand (just about) how to do so. I was looking at the examples in RWH, and I could follow the explanation of the monadic interface much easier. Perhaps this was because RWH shows how to write using the monadic interface, and then shows how to convert this to the applicative interface. It's hard to follow a tutorial that shows you how to convert from something you aren't starting with.
I suspect that this is an interesting corner case of both my two reasons – firstly, Monads are too powerful here, and secondly, you perhaps found it easier to think about the operational aspects of the parser than to think about the denotation of what the parser should parse.
Is that somewhere accurate?
I don't know. -- Colin Adams Preston Lancashire

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

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 von
Neumann paradigm. C++++.
I'd rather we strongly encourage Haskell-newbies toward shifting out of the
imperative paradigm to thinking and programming *functionally*. It's a big
shift, to make, and imperative-Haskell is a relatively easy substitute.
- Conal
On Thu, Mar 12, 2009 at 7: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_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Conal,Do you think imperative Haskell can be a sort of "gateway drug" to
"real" haskell?
On Thu, Mar 12, 2009 at 11:25 AM, Conal Elliott
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 von Neumann paradigm. C++++.
I'd rather we strongly encourage Haskell-newbies toward shifting out of the imperative paradigm to thinking and programming *functionally*. It's a big shift, to make, and imperative-Haskell is a relatively easy substitute.
- Conal
On Thu, Mar 12, 2009 at 7:28 AM, Thomas Davie
wrote: 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_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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
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 von Neumann paradigm. C++++.
I'd rather we strongly encourage Haskell-newbies toward shifting out of the imperative paradigm to thinking and programming *functionally*. It's a big shift, to make, and imperative-Haskell is a relatively easy substitute.
- Conal
On Thu, Mar 12, 2009 at 7:28 AM, Thomas Davie
wrote: 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_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Jeff Heard wrote:
Come to think of it, I've never seen an applicative tutorial of Parsec, only a monadic one. Does such a beast exist
Here's something that comes close: http://www.cs.uu.nl/research/techreps/repo/CS-2008/2008-044.pdf It's not specific to Parsec; instead, a parser type is defined on the fly, based on Philip Wadler's list of successes. The applicative and monadic approaches are clearly separated. Martijn.

Oh, I know it's not specific to parsec, it just seems like parsec's
used enough and well understood enough that it would make a good
tutorial.
On Thu, Mar 12, 2009 at 11:36 AM, Martijn van Steenbergen
Jeff Heard wrote:
Come to think of it, I've never seen an applicative tutorial of Parsec, only a monadic one. Does such a beast exist
Here's something that comes close:
http://www.cs.uu.nl/research/techreps/repo/CS-2008/2008-044.pdf
It's not specific to Parsec; instead, a parser type is defined on the fly, based on Philip Wadler's list of successes. The applicative and monadic approaches are clearly separated.
Martijn.

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
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
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 von 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 big shift, to make, and imperative-Haskell is a relatively easy substitute.
- Conal
On Thu, Mar 12, 2009 at 7:28 AM, Thomas Davie
wrote: 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,
2009/3/12 Conal Elliott
: the 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_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Thu, 12 Mar 2009, Andrew Wagner wrote:
Can you expand on this a bit? I'm curious why you think this.
http://haskell.org/haskellwiki/Type_classes_are_for_reusability We recently had a thread about that. I can't find it now.
participants (7)
-
Andrew Wagner
-
Colin Paul Adams
-
Conal Elliott
-
Henning Thielemann
-
Jeff Heard
-
Martijn van Steenbergen
-
Thomas Davie