Talk:Monad (functional programming): Difference between revisions

Content deleted Content added
Haskell: monads as values/the current cite tag
Line 41:
 
:Is this clear enough? --[[User:67.172.99.160|67.172.99.160]] 02:09, 3 December 2005 (UTC)
 
::Kind of. Monads are types with associated functions (''bind'' (written ''>>='') and ''return''). These are sometimes containers in a naive way — the List monad and Maybe monad. But monads like CPS "contain" something, but it's not directly accessible in any way. More complicated monads do even crazier things: threaded coroutines can be expressed as a monad. Taking an example from a tutorial site (sorry, can't find the URL), a monad could keep a value corresponding to the remaining number of steps to allow in the computation; when this counter reaches zero, all binds just return the value computed up to that point. None of these are "containers for values" in any sensible way.
 
::I don't think moving to "Monads in Haskell" is appropriate. It begins by describing everything abstractly, but eventually we need to discuss monads in practice. Our choices are limited to Haskell, Clean, and Miranda<sup>TM</sup>. Every other programming page just picks a language, so why not here? If another language you know of uses monads in an interesting way and with a different syntax, by all means add it in!
 
::I think the current explanation is fine. In that sense the "cite" tag is inappropriate, but it would be nice to cite some source on monads anyway. --[[User:Mgreenbe|Mgreenbe]] 10:00, 4 January 2006 (UTC)