|
A series of articles starting from the very scratch and getting to the State Monad. It's thought to be novice-friendly: although using F#, it assumes no knowledge of it. If only it aroused someone's curiosity around F#, that would make my day. It shows how algorithms with mutable state can be implemented with pure functions, with immutable variables only. The series itself is an excuse to take several detours on other Functional Programming topics: currying, partial application, recursion, Functors, Applicative Functors. The source code includes F# and C# examples. In the next weeks it will be followed by code examples showing how to apply a state monad in practice. |
On first glance, your example:
Isn't that far off from what is pretty easily done in C#: (Sharing for folks who aren't familiar with C# Tuple types and extension methods)