Skip to content

Commit 06a0f73

Browse files
authored
Merge pull request #196 from tweag/clean-up-kleisli
Clean-up in the Kleisli module
2 parents 90da049 + b4b9cd7 commit 06a0f73

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/Data/Profunctor/Kleisli/Linear.hs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,10 @@ instance Control.Applicative f => Wandering (Kleisli f) where
5555
-- profunctorial properties still hold in this weaker setting.
5656
-- However stronger requirements on `f` are needed for profunctorial
5757
-- strength, so we have fewer instances.
58-
--
59-
-- Category theoretic remark: duality doesn't work in the obvious way, since
60-
-- (,) isn't the categorical product. Instead, we have a product (&), called
61-
-- "With", defined by
62-
-- > type With a b = forall r. Either (a #-> r) (b #-> r) #-> r
63-
-- which satisfies the universal property of the product of `a` and `b`.
64-
-- CoKleisli arrows are strong with respect to this monoidal structure,
65-
-- although this might not be useful...
6658
newtype CoKleisli w a b = CoKleisli { runCoKleisli :: w a #-> b }
6759

6860
instance Data.Functor f => Profunctor (CoKleisli f) where
6961
dimap f g (CoKleisli h) = CoKleisli (g . h . Data.fmap f)
7062

71-
-- instance of a more general idea, but this will do for now
7263
instance Strong Either Void (CoKleisli (Data.Const x)) where
73-
first (CoKleisli f) = CoKleisli (\(Data.Const x) -> (Left :: a #-> Either a b) (f (Data.Const x)))
74-
-- XXX: the above type signature is necessary for certain older versions of
75-
-- the compiler, and as such is temporary
64+
first (CoKleisli f) = CoKleisli (\(Data.Const x) -> Left (f (Data.Const x)))

0 commit comments

Comments
 (0)