Exception or Either monad in C#

后端 未结 5 746
庸人自扰
庸人自扰 2021-01-31 20:56

I am trying to grok get a preliminary understanding of monads.

I have a data layer call whose result I would like to return monadically either as a result e

5条回答
  •  忘了有多久
    2021-01-31 21:34

    C# doesn't have much support for monads (and the support that is there in the form of LINQ wasn't really meant for general monads), there are no built-in Exception or Either monads. You should throw the exception and then catch it.

提交回复
热议问题