3 ms·
I agree that Applicative should be used when possible. I think the Maybe example may be wrong, though. You may need the power of Monads sometimes. If you have
by Peaker 15y ago
I agree that Applicative should be used when possible.
I think the Maybe example may be wrong, though. You may need the power of Monads sometimes. If you have a function that requires the result of a different function which was wrapped in Maybe, Applicative will not be enough.
Example:
xmlChild :: String -> Element -> Maybe Element
Now you might want to do something like:
myPath = xmlChild "a" >=> xmlChild "b" >=> xmlChild "c"