4 ms·
That particular function is tied to Maybe and Either. Good luck with that when your functions start returning all types of different monads and welcome to monad
by hota_mazi 9y ago
That particular function is tied to Maybe and Either. Good luck with that when your functions start returning all types of different monads and welcome to monad transformer hell.
- dllthomas 9y agoMaybe and Either was the topic of discussion. If you want to discuss a different example, present a different example. Attempting to speak usefully to vague generality... if your functions are returning different concrete monadic values you need to either run them and get something pure out or translate them into your current context. It's usually better practice, however, to leave the choice of monad up to the call site and only ask for the interfaces you need (MonadState, MonadReader, etc), at which point there's no call-site-local translation needed at all, you just have to make sure you're supporting the interfaces requested.