{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Control.Lens.Internal.Review
(
Reviewable
, retagged
) where
import Data.Bifunctor
import Data.Profunctor
import Data.Void
class (Profunctor p, Bifunctor p) => Reviewable p
instance (Profunctor p, Bifunctor p) => Reviewable p
retagged :: (Profunctor p, Bifunctor p) => p a b -> p s b
retagged :: forall (p :: * -> * -> *) a b s.
(Profunctor p, Bifunctor p) =>
p a b -> p s b
retagged = (Void -> s) -> p Void b -> p s b
forall a b c. (a -> b) -> p a c -> p b c
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first Void -> s
forall a. Void -> a
absurd (p Void b -> p s b) -> (p a b -> p Void b) -> p a b -> p s b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Void -> a) -> p a b -> p Void b
forall a b c. (a -> b) -> p b c -> p a c
forall (p :: * -> * -> *) a b c.
Profunctor p =>
(a -> b) -> p b c -> p a c
lmap Void -> a
forall a. Void -> a
absurd