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+ module Data.Profunctor.Closed where
2+
3+ import Prelude
4+
5+ import Data.Profunctor
6+
7+ -- | The `Closed` class extends the `Profunctor` class to work with functions.
8+ class (Profunctor p ) <= Closed p where
9+ closed :: forall a b x . p a b -> p (x -> a ) (x -> b )
10+
11+ instance Closed Function where
12+ closed = (<<<)
Original file line number Diff line number Diff line change 1+ module Data.Profunctor.Cochoice where
2+
3+ import Prelude
4+
5+ import Data.Either (Either ())
6+ import Data.Profunctor
7+
8+ -- | The `Cochoice` class provides the dual operations of the `Choice` class.
9+ class (Profunctor p ) <= Cochoice p where
10+ unleft :: forall a b c . p (Either a c ) (Either b c ) -> p a b
11+ unright :: forall a b c . p (Either a b ) (Either a c ) -> p b c
Original file line number Diff line number Diff line change 1+ module Data.Profunctor.Cochoice where
2+
3+ import Prelude
4+
5+ import Data.Either (Tuple ())
6+ import Data.Profunctor
7+
8+ -- | The `Costrong` class provides the dual operations of the `Strong` class.
9+ class (Profunctor p ) <= Costrong p where
10+ unfirst :: forall a b c . p (Tuple a c ) (Tuple b c ) -> p a b
11+ unsecond :: forall a b c . p (Tuple a b ) (Tuple a c ) -> p b c
You can’t perform that action at this time.
0 commit comments