Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • I understand your comment about UI layer binding, but in this case there exists a standardized, canonical string representation of Foo, so it makes sense to have Foo.ToString and Foo.Parse. Commented Jan 22, 2018 at 15:41
  • And, w.r.t. my bolded question, can you give me an example from the .NET BCL that uses this pattern? Commented Jan 22, 2018 at 15:46
  • 4
    How is that a monad? Commented Jan 22, 2018 at 15:49
  • @Heinzi: Any method that returns a Func<T> would meet that criteria, if you include in T the information you need. Returning detailed error information is largely up to you. Have you considered using a Maybe<T>? See mikhail.io/2016/01/monads-explained-in-csharp Commented Jan 22, 2018 at 15:49
  • 1
    @JacquesB: I was kinda wondering the same thing. The method signature is compatible with modanic behavior, but that's about it. Commented Jan 22, 2018 at 15:50