Talk:Monads/Maybe monad: Difference between revisions

Content added Content deleted
Line 22: Line 22:
:I've added a draft description of Monad. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 19:01, 2 October 2019 (UTC)
:I've added a draft description of Monad. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 19:01, 2 October 2019 (UTC)
::How do you understand the application of that formulation to, for example, the '''list''' monad (for which the bind operator is the composition of map and concat), or to the function or IO monads ? It may be that I haven't yet understood your reference in the phrases 'encapsulates several other types' and 'eliminates boiler-plate code'. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 21:35, 2 October 2019 (UTC)
::How do you understand the application of that formulation to, for example, the '''list''' monad (for which the bind operator is the composition of map and concat), or to the function or IO monads ? It may be that I haven't yet understood your reference in the phrases 'encapsulates several other types' and 'eliminates boiler-plate code'. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 21:35, 2 October 2019 (UTC)
:::I wouldn't worry about that issue. At most it's the difference between "several" and "one or more" (or even "zero or more", assuming the language supported empty monads as a construct -- they can't be used, but might have use as a placeholder in some contexts). That said, list monad does deal with both lists and elements of lists, so it is part way there.
:::I wouldn't worry about that issue. At most it's the difference between "several" and "one or more" (or even "zero or more", assuming the language supported empty monads as a construct -- they can't be used, but might have use as a placeholder in some contexts). That said, list monad does deal with both lists and elements of lists, so it is part way there. (Alternatively: in some type systems, the length of a list is a part of its type.)
:::But my quip does need a mention of bind and return. So I should fix that. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 21:54, 2 October 2019 (UTC)
:::But my quip does need a mention of bind and return. So I should fix that. --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 21:54, 2 October 2019 (UTC)