Talk:Monads/List monad: Difference between revisions

Content added Content deleted
m (→‎F# example: Expand with Pythagorean triple example.)
Line 74: Line 74:
printf "%A" (pyth_triples 100)
printf "%A" (pyth_triples 100)
</lang>
</lang>
:The task requirement is Construct a List Monad by writing the 'bind' function and the 'pure' (sometimes known as 'return') function for that Monad (or just use what the language already has implemented). The example just uses what the language already has implemented. 'let x=something" means refer to something.bind as x. In F# List is a ListMonad. F# uses yield rather than 'mu' 'pure' or 'return' see [https://fsharpforfunandprofit.com/posts/computation-expressions-builder-part1/#introducing-yield introducing yield].--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 15:20, 14 September 2021 (UTC)