{-# LANGUAGE RankNTypes #-}
module Dhall.Optics {-# DEPRECATED "Use the definitions from Lens.Micro of the microlens package directly." #-}
( Optic
, Optic'
, anyOf
, rewriteOf
, transformOf
, rewriteMOf
, transformMOf
, mapMOf
, cosmosOf
, to
, foldOf
) where
import Control.Applicative (Const (..), WrappedMonad (..))
import Data.Monoid (Any (..))
import Lens.Micro (ASetter, LensLike, Traversal, SimpleGetter)
import Lens.Micro.Internal ((#.))
import qualified Lens.Micro
type Getting r s a = (a -> Const r a) -> s -> Const r s
type Optic p f s t a b = p a (f b) -> p s (f t)
type Optic' p f s a = Optic p f s s a a
anyOf :: Getting Any s a -> (a -> Bool) -> s -> Bool
anyOf :: forall s a. Getting Any s a -> (a -> Bool) -> s -> Bool
anyOf = Getting Any s a -> (a -> Bool) -> s -> Bool
forall s a. Getting Any s a -> (a -> Bool) -> s -> Bool
Lens.Micro.anyOf
{-# INLINE anyOf #-}
rewriteOf :: ASetter a b a b -> (b -> Maybe a) -> a -> b
rewriteOf :: forall a b. ASetter a b a b -> (b -> Maybe a) -> a -> b
rewriteOf = ASetter a b a b -> (b -> Maybe a) -> a -> b
forall a b. ASetter a b a b -> (b -> Maybe a) -> a -> b
Lens.Micro.rewriteOf
{-# INLINE rewriteOf #-}
transformOf :: ASetter a b a b -> (b -> b) -> a -> b
transformOf :: forall a b. ASetter a b a b -> (b -> b) -> a -> b
transformOf = ASetter a b a b -> (b -> b) -> a -> b
forall a b. ASetter a b a b -> (b -> b) -> a -> b
Lens.Micro.transformOf
{-# INLINE transformOf #-}
rewriteMOf
:: Monad m
=> LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> a -> m b
rewriteMOf :: forall (m :: * -> *) a b.
Monad m =>
LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> a -> m b
rewriteMOf = LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> a -> m b
forall (m :: * -> *) a b.
Monad m =>
LensLike (WrappedMonad m) a b a b -> (b -> m (Maybe a)) -> a -> m b
Lens.Micro.rewriteMOf
{-# INLINE rewriteMOf #-}
transformMOf
:: Monad m => LensLike (WrappedMonad m) a b a b -> (b -> m b) -> a -> m b
transformMOf :: forall (m :: * -> *) a b.
Monad m =>
LensLike (WrappedMonad m) a b a b -> (b -> m b) -> a -> m b
transformMOf = LensLike (WrappedMonad m) a b a b -> (b -> m b) -> a -> m b
forall (m :: * -> *) a b.
Monad m =>
LensLike (WrappedMonad m) a b a b -> (b -> m b) -> a -> m b
Lens.Micro.transformMOf
{-# INLINE transformMOf #-}
mapMOf :: LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t
mapMOf :: forall (m :: * -> *) s t a b.
LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t
mapMOf = LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t
forall (m :: * -> *) s t a b.
LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t
Lens.Micro.mapMOf
{-# INLINE mapMOf #-}
cosmosOf :: Traversal s t s t -> Traversal s t s b
cosmosOf :: forall s t b. Traversal s t s t -> Traversal s t s b
cosmosOf = Traversal s t s t -> (s -> f b) -> s -> f t
Traversal s t s t -> Traversal s t s b
forall s t b. Traversal s t s t -> Traversal s t s b
Lens.Micro.cosmosOf
{-# INLINE cosmosOf #-}
to :: (s -> a) -> SimpleGetter s a
to :: forall s a. (s -> a) -> SimpleGetter s a
to = (s -> a) -> Getting r s a
(s -> a) -> SimpleGetter s a
forall s a. (s -> a) -> SimpleGetter s a
Lens.Micro.to
{-# INLINE to #-}
foldOf :: Getting a s a -> s -> a
foldOf :: forall a s. Getting a s a -> s -> a
foldOf Getting a s a
l = Const a s -> a
forall {k} a (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 foldOf #-}