module Text.PrettyBy.Internal.Utils
( view
) where
import Control.Monad.Reader
import Data.Functor.Const
import Lens.Micro
import Lens.Micro.Internal ((#.))
view :: MonadReader s m => Getting a s a -> m a
view :: Getting a s a -> m a
view Getting a s a
l = (s -> a) -> m a
forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
asks (Const a s -> a
forall a k (b :: k). Const a b -> a
getConst (Const a s -> a) -> (s -> Const a s) -> s -> a
forall c b a. Coercible c b => (b -> c) -> (a -> b) -> a -> c
#. Getting a s a
l a -> Const a a
forall k a (b :: k). a -> Const a b
Const)
{-# INLINE view #-}