3 ms·
I found this to be a great practical introduction to monads: http://codon.com/refactoring-ruby-with-monads http://codon.com/refactoring-ruby-with-monads. It hol
by 21echoes 12y ago
I found this to be a great practical introduction to monads: http://codon.com/refactoring-ruby-with-monads http://codon.com/refactoring-ruby-with-monads. It holds your hand the whole way, so it gets a bit long and tedious, but it's great at showing how three different common monads can clean up similar looking code in similar ways. I'm sure the Haskell purists out there can find 20+ different things wrong with it, or will scoff at how it's in Ruby, etc., but if you ask me those are tiny prices to pay in an introductory context for how pragmatic, explicit, and helpful it is.