bifunctors
bifunctors copied to clipboard
Add Applicative instance for Biff
This seems a bit arbitrary to me. Couldn't you write a Data.Functor.Compose-like instance like this?
instance (Applicative (p (f a)), Applicative g) => Applicative (Biff p f g a) where
pure = Biff . pure . pure
liftA2 f (Biff xs) (Biff ys) = Biff $ liftA2 (liftA2 f) xs ys
I'm not saying we should do this, but it's not at all obvious that the limited instance you suggest is the right one, if there is a right one.