{-# LANGUAGE TupleSections #-}
module Data.Bifunctor.Monoidal.Specialized where

import Prelude hiding ((&&), (||))

import Control.Category.Cartesian
import Control.Category.Tensor ()
import Data.Bifunctor.Monoidal
import Data.Functor.Contravariant
import Data.Profunctor
import Data.Void

-- | Split the input between the two argument arrows and multiply their outputs.
mux :: Semigroupal (->) (,) (,) (,) p => p a b -> p c d -> p (a, c) (b, d)
mux :: forall (p :: * -> * -> *) a b c d.
Semigroupal (->) (,) (,) (,) p =>
p a b -> p c d -> p (a, c) (b, d)
mux = forall a b c. ((a, b) -> c) -> a -> b -> c
curry forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

infixr 3 ***

-- | Infix operator for 'mux'.
(***) :: Semigroupal (->) (,) (,) (,) p => p a b -> p c d -> p (a, c) (b, d)
*** :: forall (p :: * -> * -> *) a b c d.
Semigroupal (->) (,) (,) (,) p =>
p a b -> p c d -> p (a, c) (b, d)
(***) = forall (p :: * -> * -> *) a b c d.
Semigroupal (->) (,) (,) (,) p =>
p a b -> p c d -> p (a, c) (b, d)
mux

-- | Split the input between the two argument arrows and sum their outputs.
demux :: Semigroupal (->) Either Either (,) p => p a b -> p c d -> p (Either a c) (Either b d)
demux :: forall (p :: * -> * -> *) a b c d.
Semigroupal (->) Either Either (,) p =>
p a b -> p c d -> p (Either a c) (Either b d)
demux = forall a b c. ((a, b) -> c) -> a -> b -> c
curry forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

infixr 2 +++

-- | Infix operator for 'demux'.
(+++) :: Semigroupal (->) Either Either (,) p => p a b -> p c d -> p (Either a c) (Either b d)
+++ :: forall (p :: * -> * -> *) a b c d.
Semigroupal (->) Either Either (,) p =>
p a b -> p c d -> p (Either a c) (Either b d)
(+++) = forall (p :: * -> * -> *) a b c d.
Semigroupal (->) Either Either (,) p =>
p a b -> p c d -> p (Either a c) (Either b d)
demux

-- | Send the whole input to the two argument arrows and multiply their outputs.
fanout :: (Profunctor p, Semigroupal (->) (,) (,) (,) p) => p x a -> p x b -> p x (a, b)
fanout :: forall (p :: * -> * -> *) x a b.
(Profunctor p, Semigroupal (->) (,) (,) (,) p) =>
p x a -> p x b -> p x (a, b)
fanout p x a
pxa p x b
pxb = forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
lmap forall a. a -> (a, a)
split' forall a b. (a -> b) -> a -> b
$ p x a
pxa forall (p :: * -> * -> *) a b c d.
Semigroupal (->) (,) (,) (,) p =>
p a b -> p c d -> p (a, c) (b, d)
*** p x b
pxb

infixr 3 &&&

-- | Infix operator for 'fanout'.
(&&&) :: (Profunctor p, Semigroupal (->) (,) (,) (,) p) => p x a -> p x b -> p x (a, b)
&&& :: forall (p :: * -> * -> *) x a b.
(Profunctor p, Semigroupal (->) (,) (,) (,) p) =>
p x a -> p x b -> p x (a, b)
(&&&) = forall (p :: * -> * -> *) x a b.
(Profunctor p, Semigroupal (->) (,) (,) (,) p) =>
p x a -> p x b -> p x (a, b)
fanout

-- | Split the input between the two argument arrows and merge their outputs.
fanin :: (Profunctor p, Semigroupal (->) Either Either (,) p) => p a x -> p b x -> p (Either a b) x
fanin :: forall (p :: * -> * -> *) a x b.
(Profunctor p, Semigroupal (->) Either Either (,) p) =>
p a x -> p b x -> p (Either a b) x
fanin p a x
pax p b x
pbx = forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap forall a. Either a a -> a
merge' forall a b. (a -> b) -> a -> b
$ p a x
pax forall (p :: * -> * -> *) a b c d.
Semigroupal (->) Either Either (,) p =>
p a b -> p c d -> p (Either a c) (Either b d)
+++ p b x
pbx

infixr 2 |||

-- | Infix operator for 'fanin'.
(|||) :: (Profunctor p, Semigroupal (->) Either Either (,) p) => p a x -> p b x -> p (Either a b) x
||| :: forall (p :: * -> * -> *) a x b.
(Profunctor p, Semigroupal (->) Either Either (,) p) =>
p a x -> p b x -> p (Either a b) x
(|||) = forall (p :: * -> * -> *) a x b.
(Profunctor p, Semigroupal (->) Either Either (,) p) =>
p a x -> p b x -> p (Either a b) x
fanin
    
-- | Split the input between the two argument arrows and and sum their outputs.
switch :: Semigroupal (->) (,) Either (,) p => p a b -> p c d -> p (a, c) (Either b d)
switch :: forall (p :: * -> * -> *) a b c d.
Semigroupal (->) (,) Either (,) p =>
p a b -> p c d -> p (a, c) (Either b d)
switch = forall a b c. ((a, b) -> c) -> a -> b -> c
curry forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

infixr 5 &|

-- | Infix operator for 'switch'.
(&|) :: Semigroupal (->) (,) Either (,) p => p a b -> p c d -> p (a, c) (Either b d)
&| :: forall (p :: * -> * -> *) a b c d.
Semigroupal (->) (,) Either (,) p =>
p a b -> p c d -> p (a, c) (Either b d)
(&|) = forall (p :: * -> * -> *) a b c d.
Semigroupal (->) (,) Either (,) p =>
p a b -> p c d -> p (a, c) (Either b d)
switch

-- | Send the whole input to the two argument arrows and sum their outputs.
union :: Profunctor p => Semigroupal (->) (,) Either (,) p => p x a -> p x b -> p x (Either a b)
union :: forall (p :: * -> * -> *) x a b.
(Profunctor p, Semigroupal (->) (,) Either (,) p) =>
p x a -> p x b -> p x (Either a b)
union p x a
pxa p x b
pxb = forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
lmap forall a. a -> (a, a)
split' forall a b. (a -> b) -> a -> b
$ p x a
pxa forall (p :: * -> * -> *) a b c d.
Semigroupal (->) (,) Either (,) p =>
p a b -> p c d -> p (a, c) (Either b d)
&| p x b
pxb

-- | Split the input between the two argument arrows then merge their outputs.
divide :: (Profunctor p, Semigroupal (->) (,) Either (,) p) => p a x -> p b x -> p (a, b) x
divide :: forall (p :: * -> * -> *) a x b.
(Profunctor p, Semigroupal (->) (,) Either (,) p) =>
p a x -> p b x -> p (a, b) x
divide p a x
pxa p b x
pxb = forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap forall a. Either a a -> a
merge' forall a b. (a -> b) -> a -> b
$ p a x
pxa forall (p :: * -> * -> *) a b c d.
Semigroupal (->) (,) Either (,) p =>
p a b -> p c d -> p (a, c) (Either b d)
&| p b x
pxb

-- | Split the input between the two argument arrows then multiply their outputs.
splice :: Semigroupal (->) Either (,) (,) p => p a b -> p c d -> p (Either a c) (b, d)
splice :: forall (p :: * -> * -> *) a b c d.
Semigroupal (->) Either (,) (,) p =>
p a b -> p c d -> p (Either a c) (b, d)
splice = forall a b c. ((a, b) -> c) -> a -> b -> c
curry forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

infix 5 |&

-- | Infix operator for 'splice'.
(|&) :: Semigroupal (->) Either (,) (,) p => p a b -> p c d -> p (Either a c) (b, d)
|& :: forall (p :: * -> * -> *) a b c d.
Semigroupal (->) Either (,) (,) p =>
p a b -> p c d -> p (Either a c) (b, d)
(|&) = forall (p :: * -> * -> *) a b c d.
Semigroupal (->) Either (,) (,) p =>
p a b -> p c d -> p (Either a c) (b, d)
splice

diverge :: Semigroupal (->) Either Either Either p => Either (p a b) (p c d) -> p (Either a c) (Either b d)
diverge :: forall (p :: * -> * -> *) a b c d.
Semigroupal (->) Either Either Either p =>
Either (p a b) (p c d) -> p (Either a c) (Either b d)
diverge = forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

contramapMaybe :: Profunctor p => Semigroupal (->) Either Either Either p => (a -> Maybe b) -> p b x -> p a x
contramapMaybe :: forall (p :: * -> * -> *) a b x.
(Profunctor p, Semigroupal (->) Either Either Either p) =>
(a -> Maybe b) -> p b x -> p a x
contramapMaybe a -> Maybe b
f = forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap (forall b a. b -> (a -> b) -> Maybe a -> b
maybe (forall a b. b -> Either a b
Right ()) forall a b. a -> Either a b
Left forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Maybe b
f) forall a. Either a a -> a
merge' forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> *) a b x y.
(Profunctor p, Semigroupal (->) Either Either Either p) =>
p a b -> p (Either a x) (Either b y)
ultraleft

zig :: (Profunctor p, Semigroupal (->) (,) t Either p) => Either (p x a) (p x b) -> p x (t a b)
zig :: forall (p :: * -> * -> *) (t :: * -> * -> *) x a b.
(Profunctor p, Semigroupal (->) (,) t Either p) =>
Either (p x a) (p x b) -> p x (t a b)
zig = forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
lmap forall a. a -> (a, a)
split' forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

zag :: (Profunctor p, Semigroupal (->) t Either Either p) => Either (p a x) (p b x) -> p (t a b) x
zag :: forall (p :: * -> * -> *) (t :: * -> * -> *) a x b.
(Profunctor p, Semigroupal (->) t Either Either p) =>
Either (p a x) (p b x) -> p (t a b) x
zag = forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap forall a. Either a a -> a
merge' forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

ultrafirst :: (Profunctor p, Semigroupal (->) (,) (,) Either p) => p a b -> p (a, x) (b, y)
ultrafirst :: forall (p :: * -> * -> *) a b x y.
(Profunctor p, Semigroupal (->) (,) (,) Either p) =>
p a b -> p (a, x) (b, y)
ultrafirst = forall (p :: * -> * -> *) (t :: * -> * -> *) a x b.
(Profunctor p, Semigroupal (->) t Either Either p) =>
Either (p a x) (p b x) -> p (t a b) x
zag forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> Either a b
Left forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> *) (t :: * -> * -> *) x a b.
(Profunctor p, Semigroupal (->) (,) t Either p) =>
Either (p x a) (p x b) -> p x (t a b)
zig forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> Either a b
Left

ultrasecond :: (Profunctor p, Semigroupal (->) (,) (,) Either p) => p a b -> p (x, a) (y, b)
ultrasecond :: forall (p :: * -> * -> *) a b x y.
(Profunctor p, Semigroupal (->) (,) (,) Either p) =>
p a b -> p (x, a) (y, b)
ultrasecond = forall (p :: * -> * -> *) (t :: * -> * -> *) a x b.
(Profunctor p, Semigroupal (->) t Either Either p) =>
Either (p a x) (p b x) -> p (t a b) x
zag forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. b -> Either a b
Right forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> *) (t :: * -> * -> *) x a b.
(Profunctor p, Semigroupal (->) (,) t Either p) =>
Either (p x a) (p x b) -> p x (t a b)
zig forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. b -> Either a b
Right

ultraleft :: (Profunctor p, Semigroupal (->) Either Either Either p) => p a b -> p (Either a x) (Either b y)
ultraleft :: forall (p :: * -> * -> *) a b x y.
(Profunctor p, Semigroupal (->) Either Either Either p) =>
p a b -> p (Either a x) (Either b y)
ultraleft = forall (p :: * -> * -> *) (t :: * -> * -> *) a x b.
(Profunctor p, Semigroupal (->) t Either Either p) =>
Either (p a x) (p b x) -> p (t a b) x
zag forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> Either a b
Left forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> *) (t :: * -> * -> *) x a b.
(Profunctor p, Semigroupal (->) (,) t Either p) =>
Either (p x a) (p x b) -> p x (t a b)
zig forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> Either a b
Left

ultraright :: (Profunctor p, Semigroupal (->) Either Either Either p) => p a b -> p (Either x a) (Either y b)
ultraright :: forall (p :: * -> * -> *) a b x y.
(Profunctor p, Semigroupal (->) Either Either Either p) =>
p a b -> p (Either x a) (Either y b)
ultraright = forall (p :: * -> * -> *) (t :: * -> * -> *) a x b.
(Profunctor p, Semigroupal (->) t Either Either p) =>
Either (p a x) (p b x) -> p (t a b) x
zag forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. b -> Either a b
Right forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> *) (t :: * -> * -> *) x a b.
(Profunctor p, Semigroupal (->) (,) t Either p) =>
Either (p x a) (p x b) -> p x (t a b)
zig forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. b -> Either a b
Right

comux :: forall p a b c d. Semigroupal Op (,) (,) (,) p => p (a, c) (b, d) -> (p a b, p c d)
comux :: forall (p :: * -> * -> *) a b c d.
Semigroupal Op (,) (,) (,) p =>
p (a, c) (b, d) -> (p a b, p c d)
comux = forall a b. Op a b -> b -> a
getOp forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

undivide :: forall p x a b. Profunctor p => Semigroupal Op (,) (,) (,) p => p (a, b) x -> (p a x, p b x)
undivide :: forall (p :: * -> * -> *) x a b.
(Profunctor p, Semigroupal Op (,) (,) (,) p) =>
p (a, b) x -> (p a x, p b x)
undivide = forall (p :: * -> * -> *) a b c d.
Semigroupal Op (,) (,) (,) p =>
p (a, c) (b, d) -> (p a b, p c d)
comux forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap forall a. a -> (a, a)
split'

codemux :: forall p a b c d. Semigroupal Op Either Either (,) p => p (Either a c) (Either b d) -> (p a b, p c d)
codemux :: forall (p :: * -> * -> *) a b c d.
Semigroupal Op Either Either (,) p =>
p (Either a c) (Either b d) -> (p a b, p c d)
codemux = forall a b. Op a b -> b -> a
getOp forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

partition :: forall p x a b. Profunctor p => Semigroupal Op Either Either (,) p => p x (Either a b) -> (p x a, p x b)
partition :: forall (p :: * -> * -> *) x a b.
(Profunctor p, Semigroupal Op Either Either (,) p) =>
p x (Either a b) -> (p x a, p x b)
partition = forall (p :: * -> * -> *) a b c d.
Semigroupal Op Either Either (,) p =>
p (Either a c) (Either b d) -> (p a b, p c d)
codemux forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
lmap forall a. Either a a -> a
merge'

coswitch :: forall p a b c d. Semigroupal Op Either (,) (,) p => p (Either a c) (b, d) -> (p a b, p c d)
coswitch :: forall (p :: * -> * -> *) a b c d.
Semigroupal Op Either (,) (,) p =>
p (Either a c) (b, d) -> (p a b, p c d)
coswitch = forall a b. Op a b -> b -> a
getOp forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

unfanin :: forall p x a b. Profunctor p => Semigroupal Op Either (,) (,) p => p (Either a b) x -> (p a x, p b x)
unfanin :: forall (p :: * -> * -> *) x a b.
(Profunctor p, Semigroupal Op Either (,) (,) p) =>
p (Either a b) x -> (p a x, p b x)
unfanin = forall (p :: * -> * -> *) a b c d.
Semigroupal Op Either (,) (,) p =>
p (Either a c) (b, d) -> (p a b, p c d)
coswitch forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap forall a. a -> (a, a)
split'

unzip :: forall p x a b. Profunctor p => Semigroupal Op Either (,) (,) p => p x (a, b) -> (p x a, p x b)
unzip :: forall (p :: * -> * -> *) x a b.
(Profunctor p, Semigroupal Op Either (,) (,) p) =>
p x (a, b) -> (p x a, p x b)
unzip = forall (p :: * -> * -> *) a b c d.
Semigroupal Op Either (,) (,) p =>
p (Either a c) (b, d) -> (p a b, p c d)
coswitch forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
lmap forall a. Either a a -> a
merge'

cosplice :: forall p a b c d. Semigroupal Op (,) Either (,) p => p (a, c) (Either b d) -> (p a b, p c d)
cosplice :: forall (p :: * -> * -> *) a b c d.
Semigroupal Op (,) Either (,) p =>
p (a, c) (Either b d) -> (p a b, p c d)
cosplice = forall a b. Op a b -> b -> a
getOp forall (cat :: * -> * -> *) (t1 :: * -> * -> *) (t2 :: * -> * -> *)
       (to :: * -> * -> *) (f :: * -> * -> *) x y x' y'.
Semigroupal cat t1 t2 to f =>
cat (to (f x y) (f x' y')) (f (t1 x x') (t2 y y'))
combine

terminal :: forall p a. Profunctor p => Unital (->) () () () p => p a ()
terminal :: forall (p :: * -> * -> *) a.
(Profunctor p, Unital (->) () () () p) =>
p a ()
terminal = forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
lmap (forall a b. a -> b -> a
const ()) forall a b. (a -> b) -> a -> b
$ forall (cat :: * -> * -> *) i1 i2 io (f :: * -> * -> *).
Unital cat i1 i2 io f =>
cat io (f i1 i2)
introduce ()

ppure :: forall p a. Profunctor p => Unital (->) () () () p => Strong p => p a a
ppure :: forall (p :: * -> * -> *) a.
(Profunctor p, Unital (->) () () () p, Strong p) =>
p a a
ppure = forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap ((),) forall (cat :: * -> * -> *) (t :: * -> * -> *) i x y.
Cartesian cat t i =>
cat (t x y) y
projr forall a b. (a -> b) -> a -> b
$ forall (p :: * -> * -> *) a b c.
Strong p =>
p a b -> p (a, c) (b, c)
first' (forall (cat :: * -> * -> *) i1 i2 io (f :: * -> * -> *).
Unital cat i1 i2 io f =>
cat io (f i1 i2)
introduce () :: p () ())

initial :: forall p a. Profunctor p => Unital (->) Void Void () p => p Void a
initial :: forall (p :: * -> * -> *) a.
(Profunctor p, Unital (->) Void Void () p) =>
p Void a
initial = forall (p :: * -> * -> *) b c a.
Profunctor p =>
(b -> c) -> p a b -> p a c
rmap forall a. Void -> a
absurd forall a b. (a -> b) -> a -> b
$ forall (cat :: * -> * -> *) i1 i2 io (f :: * -> * -> *).
Unital cat i1 i2 io f =>
cat io (f i1 i2)
introduce ()

poly :: forall p a b. Profunctor p => Unital (->) () Void () p => p a b
poly :: forall (p :: * -> * -> *) a b.
(Profunctor p, Unital (->) () Void () p) =>
p a b
poly = forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap (forall a b. a -> b -> a
const ()) forall a. Void -> a
absurd forall a b. (a -> b) -> a -> b
$ forall (cat :: * -> * -> *) i1 i2 io (f :: * -> * -> *).
Unital cat i1 i2 io f =>
cat io (f i1 i2)
introduce ()

mono :: forall p. Unital (->) Void () () p => p Void ()
mono :: forall (p :: * -> * -> *). Unital (->) Void () () p => p Void ()
mono = forall (cat :: * -> * -> *) i1 i2 io (f :: * -> * -> *).
Unital cat i1 i2 io f =>
cat io (f i1 i2)
introduce ()

split' :: a -> (a, a)
split' :: forall a. a -> (a, a)
split' = forall (cat :: * -> * -> *) (t :: * -> * -> *) a.
Semicartesian cat t =>
cat a (t a a)
split @(->) @(,)

merge' :: Either a a -> a
merge' :: forall a. Either a a -> a
merge' = forall (cat :: * -> * -> *) (t :: * -> * -> *) a.
Semicocartesian cat t =>
cat (t a a) a
merge @(->) @Either