3 ms·
Atomic, Composable Financial Transactions: The Power of Haskell's Purity and ADT
- clusterfoo 12y agoFrom a discussion in /r/rust. Great overall discussion about the benefits of Haskell-like abstractions. This example almost looks like magic, it really helped me understand the power of these abstractions. Often people (including myself), will ask "why bother", "why should I get a PhD in abstract math just to write a damn script. They're all turing complete languages after all." Here is a perfect, down to earth example! So simple even I got it! p.s: Not being a Haskell guy, I had to use these resources to figure out wtf was going on; they might help you too: - explains Functor: http://en.wikibooks.org/wiki/Haskell/The_Functor_class http://en.wikibooks.org/wiki/Haskell/The_Functor_class - explains Monad: http://en.wikibooks.org/wiki/Haskell/Understanding_monads http://en.wikibooks.org/wiki/Haskell/Understanding_monads - explains retry: http://chimera.labs.oreilly.com/books/1230000000929/ch10.html#sec_stm-block-until-changes http://chimera.labs.oreilly.com/books/1230000000929/ch10.htm...