module Optics.Operators
( (^.)
, (^..)
, (^?)
, (#)
, (%~)
, (%!~)
, (.~)
, (!~)
, (?~)
, (?!~)
)
where
import Optics.AffineFold
import Optics.Fold
import Optics.Getter
import Optics.Optic
import Optics.Review
import Optics.Setter
(^.) :: Is k A_Getter => s -> Optic' k is s a -> a
^. :: forall (k :: OpticKind) (s :: OpticKind) (is :: IxList)
(a :: OpticKind).
Is k A_Getter =>
s -> Optic' k is s a -> a
(^.) = forall (a :: OpticKind) (b :: OpticKind) (c :: OpticKind).
(a -> b -> c) -> b -> a -> c
flip forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(a :: OpticKind).
Is k A_Getter =>
Optic' k is s a -> s -> a
view
{-# INLINE (^.) #-}
infixl 8 ^.
(^?) :: Is k An_AffineFold => s -> Optic' k is s a -> Maybe a
^? :: forall (k :: OpticKind) (s :: OpticKind) (is :: IxList)
(a :: OpticKind).
Is k An_AffineFold =>
s -> Optic' k is s a -> Maybe a
(^?) = forall (a :: OpticKind) (b :: OpticKind) (c :: OpticKind).
(a -> b -> c) -> b -> a -> c
flip forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(a :: OpticKind).
Is k An_AffineFold =>
Optic' k is s a -> s -> Maybe a
preview
{-# INLINE (^?) #-}
infixl 8 ^?
(^..) :: Is k A_Fold => s -> Optic' k is s a -> [a]
^.. :: forall (k :: OpticKind) (s :: OpticKind) (is :: IxList)
(a :: OpticKind).
Is k A_Fold =>
s -> Optic' k is s a -> [a]
(^..) = forall (a :: OpticKind) (b :: OpticKind) (c :: OpticKind).
(a -> b -> c) -> b -> a -> c
flip forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(a :: OpticKind).
Is k A_Fold =>
Optic' k is s a -> s -> [a]
toListOf
{-# INLINE (^..) #-}
infixl 8 ^..
(#) :: Is k A_Review => Optic' k is t b -> b -> t
# :: forall (k :: OpticKind) (is :: IxList) (t :: OpticKind)
(b :: OpticKind).
Is k A_Review =>
Optic' k is t b -> b -> t
(#) = forall (k :: OpticKind) (is :: IxList) (t :: OpticKind)
(b :: OpticKind).
Is k A_Review =>
Optic' k is t b -> b -> t
review
{-# INLINE (#) #-}
infixr 8 #
(%~) :: Is k A_Setter => Optic k is s t a b -> (a -> b) -> s -> t
%~ :: forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> (a -> b) -> s -> t
(%~) = forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> (a -> b) -> s -> t
over
{-# INLINE (%~) #-}
infixr 4 %~
(%!~) :: Is k A_Setter => Optic k is s t a b -> (a -> b) -> s -> t
%!~ :: forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> (a -> b) -> s -> t
(%!~) = forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> (a -> b) -> s -> t
over'
{-# INLINE (%!~) #-}
infixr 4 %!~
(.~) :: Is k A_Setter => Optic k is s t a b -> b -> s -> t
.~ :: forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> b -> s -> t
(.~) = forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> b -> s -> t
set
{-# INLINE (.~) #-}
infixr 4 .~
(!~) :: Is k A_Setter => Optic k is s t a b -> b -> s -> t
!~ :: forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> b -> s -> t
(!~) = forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> b -> s -> t
set'
{-# INLINE (!~) #-}
infixr 4 !~
(?~) :: Is k A_Setter => Optic k is s t a (Maybe b) -> b -> s -> t
?~ :: forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a (Maybe b) -> b -> s -> t
(?~) = \Optic k is s t a (Maybe b)
o -> forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> b -> s -> t
set Optic k is s t a (Maybe b)
o forall (b :: OpticKind) (c :: OpticKind) (a :: OpticKind).
(b -> c) -> (a -> b) -> a -> c
. forall (a :: OpticKind). a -> Maybe a
Just
{-# INLINE (?~) #-}
infixr 4 ?~
(?!~) :: Is k A_Setter => Optic k is s t a (Maybe b) -> b -> s -> t
?!~ :: forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a (Maybe b) -> b -> s -> t
(?!~) = \Optic k is s t a (Maybe b)
o !b
b -> forall (k :: OpticKind) (is :: IxList) (s :: OpticKind)
(t :: OpticKind) (a :: OpticKind) (b :: OpticKind).
Is k A_Setter =>
Optic k is s t a b -> b -> s -> t
set' Optic k is s t a (Maybe b)
o (forall (a :: OpticKind). a -> Maybe a
Just b
b)
{-# INLINE (?!~) #-}
infixr 4 ?!~