3 ms·
Agreed - the original content this is cribbing from[0] is really good. Worse CSS, though :) [0] https://fsharpforfunandprofit.com/rop https://fsharpforfunandpr
by robertlagrant 4y ago
Agreed - the original content this is cribbing from[0] is really good. Worse CSS, though :)
[0] https://fsharpforfunandprofit.com/rop https://fsharpforfunandprofit.com/rop
- xnorswap 4y agoYes, this article (the OP article that is) is horribly confusing and doesn't follow the ROP architecture at all. The core idea is that instead of a Func that takes in a Foo and returns a Bar, you can take in a Maybe<Foo> and return a Maybe<Bar>. Then you don't need error handling in the outer composition, once everything is of the form F = Maybe<T1> -> Maybe<T2>, etc, then you can fully compose everything at the outer layer into a F = Maybe<T1> -> Maybe<Tn>. So then you just check for Ok() at the very end and unwrap and handle any errors there.
- robertlagrant 4y agoYeah it makes loads of sense. Syntactic sugar required to make the medicine go down, of course :)