Copyright | (c) Fumiaki Kinoshita 2017 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Re-implementation of lens combinators
- type Optic p f s t a b = p a (f b) -> p s (f t)
- type Optic' p f s a = p a (f a) -> p s (f s)
- view :: Optic' (->) (Const a) s a -> s -> a
- views :: Optic' (->) (Const r) s a -> (a -> r) -> s -> r
- over :: Optic (->) Identity s t a b -> (a -> b) -> s -> t
- withIso :: Optic (Exchange a b) Identity s t a b -> ((s -> a) -> (b -> t) -> r) -> r
- data Exchange a b s t = Exchange (s -> a) (b -> t)
- review :: Optic' Tagged Identity s a -> a -> s