ekmett / adjunctions

Simple adjunctions
http://hackage.haskell.org/package/adjunctions
Other
44 stars 27 forks source link

broken with removing Coproduct from comonad #17

Closed cnd closed 8 years ago

cnd commented 8 years ago

related commit: https://github.com/ekmett/comonad/commit/f6070674f848034ca83699a78973062dac238b8b

problematic:

instance (Adjunction f g, Adjunction f' g') =>
         Adjunction (Coproduct f f') (Product g g') where
  unit a = Pair (leftAdjunct left a) (leftAdjunct right a)
  counit = coproduct (rightAdjunct fstP) (rightAdjunct sndP)
    where
      fstP (Pair x _) = x
      sndP (Pair _ x) = x

should be somehow replaced with Sum, not sure how

   * Variable not in scope: left :: f a -> Sum f f' a
    * Perhaps you meant one of these:
        data constructor `Left' (imported from Prelude),
        left' (imported from Data.Profunctor)
      Perhaps you want to add `left' to the import list in the import of
      `Control.Arrow' (src\Data\Functor\Adjunction.hs:37:1-35).
RyanGlScott commented 8 years ago

Coproduct was removed in favor of Data.Functor.Sum. It shouldn't be too hard to swap one for the other in adjunctions.

cnd commented 8 years ago

@RyanGlScott may you check question update and help with changing Coproduct to Sum in this instance?

RyanGlScott commented 8 years ago

Sure, I can make a pull request later today.

cnd commented 8 years ago

@RyanGlScott thank you

RyanGlScott commented 8 years ago

Fixed in 24ab91585504c0d237c8cd549aedccb438368ef6.