Monads/Writer monad: Difference between revisions
m
→{{header|Factor}}: bug fix rolled into release; workaround no longer required
(Add Factor) |
m (→{{header|Factor}}: bug fix rolled into release; workaround no longer required) |
||
Line 238:
=={{header|Factor}}==
{{works with|Factor|0.99 2019-10-06}}
Factor comes with an implementation of Haskell-style monads in the <code>monads</code> vocabulary.
<lang factor>USING: kernel math math.functions monads prettyprint
FROM: monads => do ;
{
[ 5 "Started with five, " <writer> ]
[ sqrt "took square root, " <writer> ]
|