Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you implement your own type that includes the right functions with the right signatures, you can incorporate expressions with that type into LINQ expressions. Crucially, SelectMany (most notably, IEnumerable.SelectMany, but the compiler just needs a function of the right name and signature and does not care about the interface) is the monadic bind. I believe Eric Lippert expands on this in his blog series on monads: https://ericlippert.com/2013/02/21/monads-part-one/


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: