After sticking to "true" and "false" being "1" and "nil" for the entire project I'm adding explicit true/false & I'm sad I'm no longer LISP
Fair enough. I guess it doesn't matter too much as long as you got proper sum types. (Also, now thinking about Option monad...)
-
-
I'm gonna be honest. I have never really understood how you use monads, practically speaking
-
In this case, pretty easy. Say you have an operation that returns X or null. And you want to pipe that into a function taking an X and ...
-
Returning an X or null. Of course, if the first function already returned null, you don't even want to call the second.
-
An option monad is just that: a container for "X or null" and a way to call a function taking an X when given an "X or null".
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.