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
7
7
Breaking changes:
8
8
9
9
New features:
10
+ - Added ` bivoid `
10
11
11
12
Bugfixes:
12
13
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import Control.Category (identity)
4
4
import Data.Const (Const (..))
5
5
import Data.Either (Either (..))
6
6
import Data.Tuple (Tuple (..))
7
+ import Data.Unit (Unit , unit )
8
+ import Data.Function (const )
7
9
8
10
-- | A `Bifunctor` is a `Functor` from the pair category `(Type, Type)` to `Type`.
9
11
-- |
@@ -29,6 +31,10 @@ lmap f = bimap f identity
29
31
rmap :: forall f a b c . Bifunctor f => (b -> c ) -> f a b -> f a c
30
32
rmap = bimap identity
31
33
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
+
32
38
instance bifunctorEither :: Bifunctor Either where
33
39
bimap f _ (Left l) = Left (f l)
34
40
bimap _ g (Right r) = Right (g r)
You can’t perform that action at this time.
0 commit comments