@@ -80,13 +80,20 @@ instance Strong Either Void LinearArrow where
8080 first (LA f) = LA $ either (Left . f) Right
8181 second (LA g) = LA $ either Left (Right . g)
8282
83+ instance Monoidal (,) () LinearArrow where
84+ LA f *** LA g = LA $ \ (a,x) -> (f a, g x)
85+ unit = LA id
86+
8387instance Profunctor (-> ) where
8488 dimap f g h x = g (h (f x))
8589instance Strong (,) () (-> ) where
8690 first f (x, y) = (f x, y)
8791instance Strong Either Void (-> ) where
8892 first f (Left x) = Left (f x)
8993 first _ (Right y) = Right y
94+ instance Monoidal (,) () (-> ) where
95+ (f *** g) (a,x) = (f a, g x)
96+ unit () = ()
9097
9198data Exchange a b s t = Exchange (s #-> a ) (b #-> t )
9299instance Profunctor (Exchange a b ) where
@@ -104,6 +111,10 @@ instance Prelude.Applicative f => Strong Either Void (Kleisli f) where
104111 Left x -> Prelude. fmap Left (f x)
105112 Right y -> Prelude. pure (Right y)
106113
114+ instance Prelude. Applicative f => Monoidal (,) () (Kleisli f ) where
115+ Kleisli f *** Kleisli g = Kleisli (\ (x,y) -> (,) Prelude. <$> f x Prelude. <*> g y)
116+ unit = Kleisli Prelude. pure
117+
107118data Market a b s t = Market (b #-> t ) (s #-> Either t a )
108119runMarket :: Market a b s t #-> (b #-> t , s #-> Either t a )
109120runMarket (Market f g) = (f, g)
0 commit comments