File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ - 0.2.4.0
2+
3+ Bifoldable and Bitraversable instances for Of.
4+
15- 0.2.3.0
26 Add ` wrapEffect ` .
37
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ import Data.Functor.Classes
1313import Data.Foldable (Foldable )
1414import Data.Traversable (Traversable )
1515#endif
16+ #if MIN_VERSION_base(4,10,0)
17+ import Data.Bifoldable (Bifoldable , bifoldMap )
18+ import Data.Bitraversable (Bitraversable , bitraverse )
19+ #endif
1620import GHC.Generics (Generic , Generic1 )
1721
1822-- | A left-strict pair; the base functor for streams of individual elements.
@@ -49,6 +53,18 @@ instance Bifunctor Of where
4953 {-#INLINE second #-}
5054#endif
5155
56+ #if MIN_VERSION_base(4,10,0)
57+ -- | @since 0.2.4.0
58+ instance Bifoldable Of where
59+ bifoldMap f g (a :> b) = f a `mappend` g b
60+ {-#INLINE bifoldMap #-}
61+
62+ -- | @since 0.2.4.0
63+ instance Bitraversable Of where
64+ bitraverse f g (a :> b) = (:>) <$> f a <*> g b
65+ {-#INLINE bitraverse #-}
66+ #endif
67+
5268instance Monoid a => Applicative (Of a ) where
5369 pure x = mempty :> x
5470 {-#INLINE pure #-}
You can’t perform that action at this time.
0 commit comments