5 ms·
It's going the other way that's the problem. I understand .net nullable, including some of the weird edge cases and trivia. None of that seems to provide any
by recursive 5y ago
It's going the other way that's the problem. I understand .net nullable, including some of the weird edge cases and trivia. None of that seems to provide any illumination into the working of more general monads.
- nightski 5y agoWeird, when I was learning Haskell I felt like the Option type looked very familiar. Then when I learned about fmap and bind it was immediately obvious why these would be useful. You mean I can apply a function to a nullable type that has no knolwedge of nullable? Cool! Or I can compose general operations on nullables? That is neat. In fact I think this was the easiest way for me to learn monads - to learn them in the context of things I already understood.
- DaiPlusPlus 5y agoThat's because Nullable<T> and nullable-reference-types aren't monads - precisely because they aren't composable. I think this SO post covers it well: https://stackoverflow.com/questions/44965/what-is-a-monad https://stackoverflow.com/questions/44965/what-is-a-monad