Monades - I've got it! (hopefully)

Hi, I think I now understand all the stuff about monades (not the mathematics). I have just one further question. Beside of the syntactic sugar of the "do" construct and the fact that the IO monade is an "internal type of haskell": Is haskell aware of the concept of monades? As I now understand it, it is "just" a programming model rather than a concept of the language. If not, I have to start new. One problem understanding monades could be, that everywhere is written, that it is so complicated and therefore I was a bit prestressed. . . . Tobias By the way: Merry Christmas! -- Tobias Kräntzer info@tobias-kraentzer.de

On Wed, Dec 24, 2008 at 3:16 AM, Tobias Kräntzer
Hi,
I think I now understand all the stuff about monades (not the mathematics). I have just one further question.
Beside of the syntactic sugar of the "do" construct and the fact that the IO monade is an "internal type of haskell": Is haskell aware of the concept of monades? As I now understand it, it is "just" a programming model rather than a concept of the language. If not, I have to start new.
It is only a concept of the language insofar as it is needed to do IO (because of the IO monad). You are correct that it is really more of a programming model. Indeed, Haskell would be just fine if you took out IO, the class declaration of Monad, and its instances. And I have used monads in C# (but there is a bit less assurance since lambdas can have side effects). About the prestress, that's one of the motivations behind renaming them ("warm fuzzy thing" is the current tongue-in-cheek alternative). Luke

Am 24.12.2008 um 11:56 schrieb Luke Palmer:
It is only a concept of the language insofar as it is needed to do IO (because of the IO monad). You are correct that it is really more of a programming model. [...] About the prestress, that's one of the motivations behind renaming them ("warm fuzzy thing" is the current tongue-in-cheek alternative).
I think it would help a lot, if this would be mentioned in all the explanations. Maybe I over read it, but the information that monads are a data structure, which are used to do for example IO and no "special datatypes" would help. But enough programming for these days. . . . Tobias -- Tobias Kräntzer info@tobias-kraentzer.de

About the prestress, that's one of the motivations behind renaming them ("warm fuzzy thing" is the current tongue-in-cheek alternative).
in F# they renamed "Monad" to "Workflow", see e.g. Chapter 9 (p. 230) in the "Expert F#" book. http://www.expert-fsharp.com/default.aspx Also, comparing with C# (Linq notation) might be helpful, http://blogs.msdn.com/lukeh/archive/2007/08/19/monadic-parser-combinators-us... of course keeping in mind that Haskell was first (I think) and the other languages only later adapted the concept. J.W.

On Wed, 2008-12-24 at 12:05 +0000, Johannes Waldmann wrote:
in F# they renamed "Monad" to "Workflow", see e.g. Chapter 9 (p. 230) in the "Expert F#" book. http://www.expert-fsharp.com/default.aspx
I don't think this is helpful, it only really works for state-like monads. "Workflow" doesn't make sense at all for [a], for example. - George

in F# they renamed "Monad" to "Workflow",
I don't think this is helpful,
I didn't claim ... at least it's a funny attempt to introduce "warm fuzzy thing" terminology.
it only really works for state-like monads. "Workflow" doesn't make sense at all for [a], for example.
Well, it could be seen as a non-deterministic "workflow" (with none, one or several outcomes). Cf. Wadler: "how to replace failure by a list of successes" http://www.springerlink.com/content/y7450255v2670167/ Best regards, J.W.

On Wed, Dec 24, 2008 at 12:05 PM, Johannes Waldmann < waldmann@imn.htwk-leipzig.de> wrote:
About the prestress, that's one of the motivations behind renaming them ("warm fuzzy thing" is the current tongue-in-cheek alternative).
in F# they renamed "Monad" to "Workflow", see e.g. Chapter 9 (p. 230) in the "Expert F#" book. http://www.expert-fsharp.com/default.aspx
I thought it was called "computation expressions",and workflow was just a special case (e.g. asynchronous work flows for the async monad)? See e.g. http://blogs.msdn.com/dsyme/archive/2007/09/22/some-details-on-f-computation... -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862

I wouldn't call it a "programming model" so much as a library. A
"programming model" sounds to me like an idiom, whereas there's an actual
typeclass in the standard library called Monad. Yes, there's special sugar
built into GHC (and, likely, any haskell implementation) for it, but it
really is at its heart just a typeclass.
On Wed, Dec 24, 2008 at 5:28 AM, Tobias Kräntzer
Am 24.12.2008 um 11:56 schrieb Luke Palmer:
It is only a concept of the language insofar as it is needed to do IO (because of the IO monad). You are correct that it is really more of a programming model. [...] About the prestress, that's one of the motivations behind renaming them ("warm fuzzy thing" is the current tongue-in-cheek alternative).
I think it would help a lot, if this would be mentioned in all the explanations. Maybe I over read it, but the information that monads are a data structure, which are used to do for example IO and no "special datatypes" would help.
But enough programming for these days.
. . . Tobias
-- Tobias Kräntzer info@tobias-kraentzer.de
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, 2008-12-24 at 11:03 -0600, Andrew Wagner wrote:
I wouldn't call it a "programming model" so much as a library. A "programming model" sounds to me like an idiom, whereas there's an actual typeclass in the standard library called Monad. Yes, there's special sugar built into GHC (and, likely, any haskell implementation) for it, but it really is at its heart just a typeclass.
do notation is in the Haskell 98 standard.
participants (7)
-
Andrew Wagner
-
Derek Elkins
-
George Pollard
-
Johannes Waldmann
-
Luke Palmer
-
Sebastian Sylvan
-
Tobias Kräntzer