My personal exercises monads in C # language using 'NUnit' and 'Fake It Easy' background.
'Monad' class contains real monad. 'StrangeMonad' class contains evolution form just extended method to generic extended method and later to monad implemented in 'Monad' class.
There are:
- With
- Do
- If
- Log
monads.
I created a sample set of classes in BuildingFactory for testing monads.
In the beginning of each test class:
- Do_MonadTest,
- If_MonadTest,
- Log_MonadTest,
- With_MonadTest
there is an old, ordinary and ugly solution and then new beautiful monad fix.
Inspired: https://blogs.claritycon.com/blog/2013/08/functional-concepts-c/