For an uncertainty-propagating Approximate type, I\'d like to have instances for Functor
through Monad
. This however doesn\'t work because I need a
As I understand it (as a non---category theorist), the fundamental operation is zip :: f a -> f b -> f (a, b)
(mapping a pair of effectful computations to an effectful computation resulting in a pair).
You can then define
fx <*> fy = uncurry ($) <$> zip fx fy
liftA2 g fx fy = uncurry g <$> zip fx fy
See this post by Edward Yang, which I found via the Typeclassopedia.