Safe Haskell | None |
---|
A module providing simple Lens functionality
- type Iso s t a b = forall p f. (Functor f, Bifunctor p) => p s (f t) -> p a (f b)
- type Iso' a b = Iso b b a a
- data MkIso a b s t = MkIso (s -> a) (b -> t)
- type LensLike f s t a b = (s -> f t) -> a -> f b
- type LensLike' f a b = LensLike f b b a a
- type Lens s t a b = forall f. Functor f => LensLike f s t a b
- type Lens' a b = Lens b b a a
- type Traversal s t a b = forall f. Applicative f => LensLike f s t a b
- type Traversal' a b = Traversal b b a a
- iso :: (a -> s) -> (t -> b) -> Iso s t a b
- from :: MkIso t s b a -> Iso a b s t
- lens :: (a -> s) -> (a -> t -> b) -> Lens s t a b
- lam :: Functor f => (a -> s) -> LensLike f s t a a
- prism :: (a -> b :+: s) -> (a -> t -> b) -> Traversal s t a b
- (^.) :: a -> Lens' a b -> b
- (%~) :: Traversal' a b -> (b -> b) -> a -> a
- (.~) :: Traversal' a b -> b -> a -> a
- _1 :: Lens' (a :*: b) a
- _2 :: Lens' (a :*: b) b
- _l :: Traversal' (a :+: b) a
- _r :: Traversal' (a :+: b) b
- _both :: Traversal a b (a, a) (b, b)
- _list :: Iso' [a] (() :+: (a :*: [a]))
- _head :: Traversal' [a] a
- _tail :: Traversal' [a] [a]
- _dropping :: Int -> Traversal' [a] [a]
- class Wrapped s t a b | a -> s, b -> t, a t -> s, b s -> t where
- wrapping :: Wrapped b b a a => (a -> b) -> Iso' a b
The lens types
MkIso (s -> a) (b -> t) |
type Traversal s t a b = forall f. Applicative f => LensLike f s t a bSource
type Traversal' a b = Traversal b b a aSource
Constructing lenses
Extracting values
(%~) :: Traversal' a b -> (b -> b) -> a -> aSource
(.~) :: Traversal' a b -> b -> a -> aSource
Basic lenses
_l :: Traversal' (a :+: b) aSource
_r :: Traversal' (a :+: b) bSource
_head :: Traversal' [a] aSource
_tail :: Traversal' [a] [a]Source
_dropping :: Int -> Traversal' [a] [a]Source