File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
src/Data/Profunctor/Kleisli Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -55,21 +55,10 @@ instance Control.Applicative f => Wandering (Kleisli f) where
55
55
-- profunctorial properties still hold in this weaker setting.
56
56
-- However stronger requirements on `f` are needed for profunctorial
57
57
-- 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...
66
58
newtype CoKleisli w a b = CoKleisli { runCoKleisli :: w a #-> b }
67
59
68
60
instance Data. Functor f => Profunctor (CoKleisli f ) where
69
61
dimap f g (CoKleisli h) = CoKleisli (g . h . Data. fmap f)
70
62
71
- -- instance of a more general idea, but this will do for now
72
63
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)))
You can’t perform that action at this time.
0 commit comments