{-# LANGUAGE Rank2Types #-}
module Lens.Family2 (
to, LF.view, (LF.^.)
, folding, LF.views, (^..), (^?)
, toListOf, allOf, anyOf, firstOf, lastOf, sumOf, productOf
, lengthOf, nullOf
, matching
, over, (%~), set, (.~)
, LF.review, zipWithOf, degrating
, under, reset
, (LF.&)
, (+~), (*~), (-~), (//~), (&&~), (||~), (<>~)
, Adapter, Adapter'
, Prism, Prism'
, Lens, Lens'
, Traversal, Traversal'
, Setter, Setter'
, Getter, Getter'
, Fold, Fold'
, Grate, Grate'
, Grid, Grid'
, Reviewer, Reviewer'
, LF.AdapterLike, LF.AdapterLike'
, LF.LensLike, LF.LensLike'
, LF.GrateLike, LF.GrateLike'
, LF.FoldLike, LF.FoldLike'
, LF.Constant
, LF.Phantom
, Identical
) where
import qualified Lens.Family as LF
import Lens.Family2.Unchecked
type Grid s t a b = forall f g. (Applicative f, Functor g) => LF.AdapterLike f g s t a b
type Grid' s a = forall f g. (Applicative f, Functor g) => LF.AdapterLike' f g s a
type Fold s t a b = forall f. (LF.Phantom f, Applicative f) => LF.LensLike f s t a b
type Fold' s a = forall f. (LF.Phantom f, Applicative f) => LF.LensLike' f s a
type Getter s t a b = forall f. LF.Phantom f => LF.LensLike f s t a b
type Getter' s a = forall f. LF.Phantom f=> LF.LensLike' f s a
type Reviewer s t a b = forall f. LF.Phantom f => LF.GrateLike f s t a b
type Reviewer' s a = forall f. LF.Phantom f => LF.GrateLike' f s a
to :: (s -> a) -> Getter s t a b
to :: forall s a t b. (s -> a) -> Getter s t a b
to s -> a
sa = (s -> a) -> LensLike f s t a b
forall (f :: * -> *) s a t b.
Phantom f =>
(s -> a) -> LensLike f s t a b
LF.to s -> a
sa
folding :: Foldable f => (s -> f a) -> Fold s t a b
folding :: forall (f :: * -> *) s a t b.
Foldable f =>
(s -> f a) -> Fold s t a b
folding s -> f a
sa = (s -> f a) -> LensLike f s t a b
forall (g :: * -> *) (f :: * -> *) s a t b.
(Foldable g, Phantom f, Applicative f) =>
(s -> g a) -> LensLike f s t a b
LF.folding s -> f a
sa
toListOf :: Fold s t a b -> s -> [a]
toListOf :: forall s t a b. Fold s t a b -> s -> [a]
toListOf Fold s t a b
l = FoldLike [a] s t a b -> s -> [a]
forall a s t b. FoldLike [a] s t a b -> s -> [a]
LF.toListOf FoldLike [a] s t a b
Fold s t a b
l
allOf :: Fold s t a b -> (a -> Bool) -> s -> Bool
allOf :: forall s t a b. Fold s t a b -> (a -> Bool) -> s -> Bool
allOf Fold s t a b
l = FoldLike All s t a b -> (a -> Bool) -> s -> Bool
forall s t a b. FoldLike All s t a b -> (a -> Bool) -> s -> Bool
LF.allOf FoldLike All s t a b
Fold s t a b
l
anyOf :: Fold s t a b -> (a -> Bool) -> s -> Bool
anyOf :: forall s t a b. Fold s t a b -> (a -> Bool) -> s -> Bool
anyOf Fold s t a b
l = FoldLike Any s t a b -> (a -> Bool) -> s -> Bool
forall s t a b. FoldLike Any s t a b -> (a -> Bool) -> s -> Bool
LF.anyOf FoldLike Any s t a b
Fold s t a b
l
firstOf :: Fold s t a b -> s -> Maybe a
firstOf :: forall s t a b. Fold s t a b -> s -> Maybe a
firstOf Fold s t a b
l = FoldLike (First a) s t a b -> s -> Maybe a
forall a s t b. FoldLike (First a) s t a b -> s -> Maybe a
LF.firstOf FoldLike (First a) s t a b
Fold s t a b
l
lastOf :: Fold s t a b -> s -> Maybe a
lastOf :: forall s t a b. Fold s t a b -> s -> Maybe a
lastOf Fold s t a b
l = FoldLike (Last a) s t a b -> s -> Maybe a
forall a s t b. FoldLike (Last a) s t a b -> s -> Maybe a
LF.lastOf FoldLike (Last a) s t a b
Fold s t a b
l
sumOf :: Num a => Fold s t a b -> s -> a
sumOf :: forall a s t b. Num a => Fold s t a b -> s -> a
sumOf Fold s t a b
l = FoldLike (Sum a) s t a b -> s -> a
forall a s t b. Num a => FoldLike (Sum a) s t a b -> s -> a
LF.sumOf FoldLike (Sum a) s t a b
Fold s t a b
l
productOf :: Num a => Fold s t a b -> s -> a
productOf :: forall a s t b. Num a => Fold s t a b -> s -> a
productOf Fold s t a b
l = FoldLike (Product a) s t a b -> s -> a
forall a s t b. Num a => FoldLike (Product a) s t a b -> s -> a
LF.productOf FoldLike (Product a) s t a b
Fold s t a b
l
lengthOf :: Num r => Fold s t a b -> s -> r
lengthOf :: forall r s t a b. Num r => Fold s t a b -> s -> r
lengthOf Fold s t a b
l = FoldLike (Sum r) s t a b -> s -> r
forall r s t a b. Num r => FoldLike (Sum r) s t a b -> s -> r
LF.lengthOf FoldLike (Sum r) s t a b
Fold s t a b
l
nullOf :: Fold s t a b -> s -> Bool
nullOf :: forall s t a b. Fold s t a b -> s -> Bool
nullOf Fold s t a b
l = FoldLike All s t a b -> s -> Bool
forall s t a b. FoldLike All s t a b -> s -> Bool
LF.nullOf FoldLike All s t a b
Fold s t a b
l
infixl 8 ^..
(^..) :: s -> Fold s t a b -> [a]
s
x^.. :: forall s t a b. s -> Fold s t a b -> [a]
^..Fold s t a b
l = s
x s -> FoldLike [a] s t a b -> [a]
forall s a t b. s -> FoldLike [a] s t a b -> [a]
LF.^.. FoldLike [a] s t a b
Fold s t a b
l
infixl 8 ^?
(^?) :: s -> Fold s t a b -> Maybe a
s
x^? :: forall s t a b. s -> Fold s t a b -> Maybe a
^?Fold s t a b
l = s
x s -> FoldLike (First a) s t a b -> Maybe a
forall s a t b. s -> FoldLike (First a) s t a b -> Maybe a
LF.^? FoldLike (First a) s t a b
Fold s t a b
l
matching :: Traversal s t a b -> s -> Either t a
matching :: forall s t a b. Traversal s t a b -> s -> Either t a
matching Traversal s t a b
l = LensLike (Either a) s t a b -> s -> Either t a
forall a s t b. LensLike (Either a) s t a b -> s -> Either t a
LF.matching LensLike (Either a) s t a b
Traversal s t a b
l
zipWithOf :: Grate s t a b -> (a -> a -> b) -> s -> s -> t
zipWithOf :: forall s t a b. Grate s t a b -> (a -> a -> b) -> s -> s -> t
zipWithOf Grate s t a b
l = GrateLike (Product Identity Identity) s t a b
-> (a -> a -> b) -> s -> s -> t
forall s t a b.
GrateLike (Product Identity Identity) s t a b
-> (a -> a -> b) -> s -> s -> t
LF.zipWithOf GrateLike (Product Identity Identity) s t a b
Grate s t a b
l
degrating :: Grate s t a b -> ((s -> a) -> b) -> t
degrating :: forall s t a b. Grate s t a b -> ((s -> a) -> b) -> t
degrating Grate s t a b
l = AGrate s t a b -> ((s -> a) -> b) -> t
forall s t a b. AGrate s t a b -> ((s -> a) -> b) -> t
LF.degrating AGrate s t a b
Grate s t a b
l
under :: Resetter s t a b -> (a -> b) -> s -> t
under :: forall s t a b. Resetter s t a b -> (a -> b) -> s -> t
under Resetter s t a b
l = AResetter s t a b -> (a -> b) -> s -> t
forall s t a b. AResetter s t a b -> (a -> b) -> s -> t
LF.under AResetter s t a b
Resetter s t a b
l
reset :: Resetter s t a b -> b -> s -> t
reset :: forall s t a b. Resetter s t a b -> b -> s -> t
reset Resetter s t a b
l = AResetter s t a b -> b -> s -> t
forall s t a b. AResetter s t a b -> b -> s -> t
LF.reset AResetter s t a b
Resetter s t a b
l
over :: Setter s t a b -> (a -> b) -> s -> t
over :: forall s t a b. Setter s t a b -> (a -> b) -> s -> t
over Setter s t a b
l = ASetter s t a b -> (a -> b) -> s -> t
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
LF.over ASetter s t a b
Setter s t a b
l
infixr 4 %~
(%~) :: Setter s t a b -> (a -> b) -> s -> t
Setter s t a b
l %~ :: forall s t a b. Setter s t a b -> (a -> b) -> s -> t
%~ a -> b
f = LensLike Identity s t a b
Setter s t a b
l LensLike Identity s t a b -> (a -> b) -> s -> t
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
LF.%~ a -> b
f
infixr 4 .~
(.~) :: Setter s t a b -> b -> s -> t
Setter s t a b
l .~ :: forall s t a b. Setter s t a b -> b -> s -> t
.~ b
b = LensLike Identity s t a b
Setter s t a b
l LensLike Identity s t a b -> b -> s -> t
forall s t a b. ASetter s t a b -> b -> s -> t
LF..~ b
b
set :: Setter s t a b -> b -> s -> t
set :: forall s t a b. Setter s t a b -> b -> s -> t
set Setter s t a b
l = ASetter s t a b -> b -> s -> t
forall s t a b. ASetter s t a b -> b -> s -> t
LF.set ASetter s t a b
Setter s t a b
l
infixr 4 +~, -~, *~
(+~), (-~), (*~) :: Num a => Setter s t a a -> a -> s -> t
Setter s t a a
l +~ :: forall a s t. Num a => Setter s t a a -> a -> s -> t
+~ a
a = LensLike Identity s t a a
Setter s t a a
l LensLike Identity s t a a -> a -> s -> t
forall a s t. Num a => ASetter s t a a -> a -> s -> t
LF.+~ a
a
Setter s t a a
l -~ :: forall a s t. Num a => Setter s t a a -> a -> s -> t
-~ a
a = LensLike Identity s t a a
Setter s t a a
l LensLike Identity s t a a -> a -> s -> t
forall a s t. Num a => ASetter s t a a -> a -> s -> t
LF.-~ a
a
Setter s t a a
l *~ :: forall a s t. Num a => Setter s t a a -> a -> s -> t
*~ a
a = LensLike Identity s t a a
Setter s t a a
l LensLike Identity s t a a -> a -> s -> t
forall a s t. Num a => ASetter s t a a -> a -> s -> t
LF.*~ a
a
infixr 4 //~
(//~) :: Fractional a => Setter s t a a -> a -> s -> t
Setter s t a a
l //~ :: forall a s t. Fractional a => Setter s t a a -> a -> s -> t
//~ a
a = LensLike Identity s t a a
Setter s t a a
l LensLike Identity s t a a -> a -> s -> t
forall a s t. Fractional a => ASetter s t a a -> a -> s -> t
LF.//~ a
a
infixr 4 &&~, ||~
(&&~), (||~) :: Setter s t Bool Bool -> Bool -> s -> t
Setter s t Bool Bool
l &&~ :: forall s t. Setter s t Bool Bool -> Bool -> s -> t
&&~ Bool
a = LensLike Identity s t Bool Bool
Setter s t Bool Bool
l LensLike Identity s t Bool Bool -> Bool -> s -> t
forall s t. ASetter s t Bool Bool -> Bool -> s -> t
LF.&&~ Bool
a
Setter s t Bool Bool
l ||~ :: forall s t. Setter s t Bool Bool -> Bool -> s -> t
||~ Bool
a = LensLike Identity s t Bool Bool
Setter s t Bool Bool
l LensLike Identity s t Bool Bool -> Bool -> s -> t
forall s t. ASetter s t Bool Bool -> Bool -> s -> t
LF.||~ Bool
a
infixr 4 <>~
(<>~) :: (Monoid a) => Setter s t a a -> a -> s -> t
Setter s t a a
l <>~ :: forall a s t. Monoid a => Setter s t a a -> a -> s -> t
<>~ a
a = LensLike Identity s t a a
Setter s t a a
l LensLike Identity s t a a -> a -> s -> t
forall a s t. Monoid a => ASetter s t a a -> a -> s -> t
LF.<>~ a
a