Monads/Writer monad: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
# Write three simple functions: root, addOne, and half |
# Write three simple functions: root, addOne, and half |
||
# Derive Writer monad versions of each of these functions |
# Derive Writer monad versions of each of these functions |
||
# Apply a composition of the Writer versions of root, addOne, and half to the integer 5, deriving both a value for the Golden Ratio φ, and a concatenated log of the function applications (starting with the initial value, and followed by the application of root, etc. |
# Apply a composition of the Writer versions of root, addOne, and half to the integer 5, deriving both a value for the Golden Ratio φ, and a concatenated log of the function applications (starting with the initial value, and followed by the application of root, etc.) |
||