bifunctors icon indicating copy to clipboard operation
bifunctors copied to clipboard

WrappedBifunctor should have an Applicative instance

Open treeowl opened this issue 2 years ago • 0 comments

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 #-}

treeowl avatar Sep 06 '21 22:09 treeowl