@@ -18,7 +18,7 @@ module Data.Generics.Internal.Lens where
18import Control.Applicative (Const(..))
18import Control.Applicative (Const(..))
19import Data.Functor.Identity (Identity(..))
19import Data.Functor.Identity (Identity(..))
20import Data.Profunctor (Choice(right'), Profunctor(dimap))
20import Data.Profunctor (Choice(right'), Profunctor(dimap))
21−import GHC.Generics ((:*:)(..), (:+:)(..), Generic(..), K1(..), M1(..), Rep)
21+import GHC.Generics ((:*:)(..), (:+:)(..), Generic(..), M1(..), Rep)
23-- | Type alias for lens
23-- | Type alias for lens
24type Lens' s a
24type Lens' s a
@@ -76,8 +76,6 @@ repIso = dimap from (fmap to)
76mIso :: Iso' (M1 i c f p) (f p)
76mIso :: Iso' (M1 i c f p) (f p)
77mIso = dimap unM1 (fmap M1)
77mIso = dimap unM1 (fmap M1)
79−kIso :: Iso' (K1 t a x) a
80−kIso = dimap unK1 (fmap K1)
82sumIso :: Iso' ((a :+: b) x) (Either (a x) (b x))
80sumIso :: Iso' ((a :+: b) x) (Either (a x) (b x))
83sumIso = dimap f (fmap t)
81sumIso = dimap f (fmap t)