GHC.Toolchain.Lens

ghc-toolchain-0.1.0.0: Utility for managing GHC target toolchains

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Toolchain.Lens

Description

A very simple Lens implementation

Synopsis

- data Lens a b = Lens {
  - view :: a -> b
  - set :: b -> a -> a
  }
- (%) :: Lens a b -> Lens b c -> Lens a c
- over :: Lens a b -> (b -> b) -> a -> a
- (%++) :: Lens a [b] -> b -> a -> a
- (&) :: a -> (a -> b) -> b

# Documentation

data Lens a b Source #

Constructors

Lens |
Fields view :: a -> b set :: b -> a -> a

(%) :: Lens a b -> Lens b c -> Lens a c Source #

over :: Lens a b -> (b -> b) -> a -> a Source #

(%++) :: Lens a [b] -> b -> a -> a Source #

Append `b` to `[b]`

Example usage: @`cc & _ccProgram % _prgFlags %++ "-U__i686"` @

(&) :: a -> (a -> b) -> b #