bifunctors
bifunctors copied to clipboard
WrappedBifunctor should have an Applicative instance
instance (Biapplicative p, Monoid a) => Applicative (WrappedBifunctor p a) where
pure a = WrapBifunctor (bipure mempty a)
{-# inline pure #-}
liftA2 f (WrapBifunctor xs) (WrapBifunctor ys) = WrapBifunctor $ biliftA2 mappend f xs ys
{-# inline liftA2 #-}