You didn't specify what kind of monads you were talking about. When I see the word "monad" I think of mathematical ones, not programmatic ones. Admittedly, I was being a smart-ass by pointing that out instead of taking your claim in the spirit that it was meant.
And, I assure you, it is a decent (though sloppy and hand-wavy) explanation. Most (all?) mathematical explanations are statements.
Oh, I noticed the intellectual trickery claim. :) I happen to like being tricksy sometimes.
I wasn't trying to get one over on you. I'm trying to flush out mathematically minded people on jyte. I have a theory that there's a higher than normal concentration of "math people" around here, and I'm trying to gather data points.
I apologize for my intellectual trickery, and won't aim it at you any more.
"From what I gather, monads aren't of any use procedural languages."
Laaaate to the party, but in my absence I've been learning random things. The whole reason monads exist in Haskell is that in a purely functional language, one cannot specify that things happen in a certain order. However, if you have a VALUE (monad) that describes the order in which things must be evaluated, then that value can be evaluated at a certain time and you're good.
Procedural languages just have....you know...statements.
But still monads might be useful because they are also state abstactions.
I get the sense that monads would be useful in web programming as a step up from continuations. But it's so hard to find good, simple but non toy examples.
Discussion (12)
Totally untrue. My explanation had nothing to do with haskell.
That is disengenuous. It was NOT a practical explanation. In fact it wasn't really an explanation at all, it was a statement.
You didn't specify what kind of monads you were talking about. When I see the word "monad" I think of mathematical ones, not programmatic ones. Admittedly, I was being a smart-ass by pointing that out instead of taking your claim in the spirit that it was meant.
And, I assure you, it is a decent (though sloppy and hand-wavy) explanation. Most (all?) mathematical explanations are statements.
I refer you to my claim "intellectual trickery sucks".
Too much of it here. I know you're smart. Why do you have to get one over on me to prove it?
From what I gather, monads aren't of any use procedural languages.
Here's a good article. In Python.
http://lukeplant.me.uk/blog.php?id=1107301643
Oh, I noticed the intellectual trickery claim. :) I happen to like being tricksy sometimes.
I wasn't trying to get one over on you. I'm trying to flush out mathematically minded people on jyte. I have a theory that there's a higher than normal concentration of "math people" around here, and I'm trying to gather data points.
I apologize for my intellectual trickery, and won't aim it at you any more.
"From what I gather, monads aren't of any use procedural languages."
Laaaate to the party, but in my absence I've been learning random things. The whole reason monads exist in Haskell is that in a purely functional language, one cannot specify that things happen in a certain order. However, if you have a VALUE (monad) that describes the order in which things must be evaluated, then that value can be evaluated at a certain time and you're good.
Procedural languages just have....you know...statements.
But still monads might be useful because they are also state abstactions.
I get the sense that monads would be useful in web programming as a step up from continuations. But it's so hard to find good, simple but non toy examples.
I'm actually trying to get MacLane's Category Theory book for Christmas so that I can learn more about the theoretical basis for monads.
PS. Since I've got your attention, could you recommend a Scheme implementation to learn on? There are like 6634634634 and I'm lost.
gnu-guile (http://gnu.org/software/guile) or Scheme48.
I find guile the most sane and useful, probably because it was specifically designed for hackers.
My trouble is I don't really understand stuff until I see a practical example and all the examples of monad's are mad.
I get simple monads like the identity stuff. But they're too simple to be useful.
So does Pierce have decent practical examples of complex monads?
Ok. Since I am also interested in the type lambda calculus (the untyped one I do understand) maybe I'll give it a whirl.
Cheers Patrick.