module Optics.Review
(
Review
, unto
, review
, A_Review
)
where
import Data.Profunctor.Indexed
import Optics.Internal.Bi
import Optics.Internal.Optic
type Review t b = Optic' A_Review NoIx t b
review :: Is k A_Review => Optic' k is t b -> b -> t
review :: Optic' k is t b -> b -> t
review Optic' k is t b
o = Tagged (Curry is Any) t t -> t
forall i a b. Tagged i a b -> b
unTagged (Tagged (Curry is Any) t t -> t)
-> (Tagged Any b b -> Tagged (Curry is Any) t t)
-> Tagged Any b b
-> t
forall b c a. Coercible b c => (b -> c) -> (a -> b) -> a -> c
#. Optic A_Review is t t b b
-> Optic_ A_Review Tagged Any (Curry is Any) t t b b
forall (p :: * -> * -> * -> *) k (is :: IxList) s t a b i.
Profunctor p =>
Optic k is s t a b -> Optic_ k p i (Curry is i) s t a b
getOptic (Optic' k is t b -> Optic A_Review is t t b b
forall destKind srcKind (is :: IxList) s t a b.
Is srcKind destKind =>
Optic srcKind is s t a b -> Optic destKind is s t a b
castOptic @A_Review Optic' k is t b
o) (Tagged Any b b -> t) -> (b -> Tagged Any b b) -> b -> t
forall a b c. Coercible a b => (b -> c) -> (a -> b) -> a -> c
.# b -> Tagged Any b b
forall i a b. b -> Tagged i a b
Tagged
{-# INLINE review #-}
unto :: (b -> t) -> Review t b
unto :: (b -> t) -> Review t b
unto b -> t
f = (forall (p :: * -> * -> * -> *) i.
Profunctor p =>
Optic_ A_Review p i (Curry NoIx i) t t b b)
-> Review t b
forall k (is :: IxList) s t a b.
(forall (p :: * -> * -> * -> *) i.
Profunctor p =>
Optic_ k p i (Curry is i) s t a b)
-> Optic k is s t a b
Optic (p i b t -> p i t t
forall (p :: * -> * -> * -> *) i a c b.
(Profunctor p, Bifunctor p) =>
p i a c -> p i b c
lphantom (p i b t -> p i t t) -> (p i b b -> p i b t) -> p i b b -> p i t t
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (b -> t) -> p i b b -> p i b t
forall (p :: * -> * -> * -> *) c d i b.
Profunctor p =>
(c -> d) -> p i b c -> p i b d
rmap b -> t
f)
{-# INLINE unto #-}