Content deleted Content added
Ancheta Wis (talk | contribs) →Sample adjunct supposition: +anchor |
Ancheta Wis (talk | contribs) →An example: Maybe: +wiki link |
||
Line 85:
let maybe_x: Maybe<Decimal> = Just(1.0)
let maybe_result = maybe_x.map(|x| add_one(x)).map(|x| decimal_to_string(x))
</syntaxhighlight>In Haskell, there is an operator ''bind'', or (<code>>>=</code>) that allows for this monadic composition in a more elegant form similar to [[function composition]].{{efn|name= gHutton2ndBind|Hutton abstracts a <code>bind</code> which when given a type ''a'' that may fail, and a mapping ''a''→''b'' that may fail, produces a result ''b'' that may fail. (Hutton, 2016)<ref name=gHutton2016/> }}{{rp|150-151}}
<syntaxhighlight lang="haskell">
|