Timeline for Railway Oriented Programming (ROP) in C#
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 19, 2018 at 1:52 | comment | added | Luis | It is because people think Linq is only for IEnumerable, but Linq can be used with any type. In this case, Option/Maybe types works like a single element enumerable. You can implement idioms with linq. | |
Sep 2, 2017 at 0:40 | comment | added | RubberDuck | Implementing SelectMany and using query syntax seems to be a common way to implement monads in C#. I don't like it either, but it's a nightmare to call SelectMany with lambda syntax. | |
Aug 16, 2017 at 12:21 | comment | added | Ibrahim ben Salah | The confusion about Validate is caused by the result type ValidationError<T> but what I intended to show here is that you can return any custom type. In real scenario's the result type should be IMonad<T> or any type that represents wether the operation had succeeded or failed. The whole benefit of ROP is to hide errors and error handling and only show the happy path in the query. So that means you would only pass Person objects around or it's Age. It also means that error handling can be implemented in one location, as I showed with ValidationError<T> | |
Aug 16, 2017 at 11:55 | comment | added | Ibrahim ben Salah | In short I think you re right, in fact I already changed my code in the github repo because I came to the same conclusion. In the resulting code there contains only IMonad of T and supporting extensions methods. Working with Func like I showed before might be still beneficial tho for composing functions but that has nothing to do with Monads. | |
Aug 15, 2017 at 20:59 | history | answered | t3chb0t | CC BY-SA 3.0 |