File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ Notable changes to this project are documented in this file. The format is based
77Breaking changes:
88
99New features:
10+ - Added ` bivoid `
1011
1112Bugfixes:
1213
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import Control.Category (identity)
44import Data.Const (Const (..))
55import Data.Either (Either (..))
66import Data.Tuple (Tuple (..))
7+ import Data.Unit (Unit , unit )
8+ import Data.Function (const )
79
810-- | A `Bifunctor` is a `Functor` from the pair category `(Type, Type)` to `Type`.
911-- |
@@ -29,6 +31,10 @@ lmap f = bimap f identity
2931rmap :: forall f a b c . Bifunctor f => (b -> c ) -> f a b -> f a c
3032rmap = bimap identity
3133
34+ -- | The bivoid function is used to ignore the types wrapped by a Bifunctor.
35+ bivoid :: forall f a b . Bifunctor f => f a b -> f Unit Unit
36+ bivoid = bimap (const unit) (const unit)
37+
3238instance bifunctorEither :: Bifunctor Either where
3339 bimap f _ (Left l) = Left (f l)
3440 bimap _ g (Right r) = Right (g r)
You can’t perform that action at this time.
0 commit comments