HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-toolchain-0.1.0.0Haskell2010

GHC.Toolchain.Lens

A very simple Lens implementation

  • 1 type
  • 4 values
valueover :: Lens a b -> (b -> b) -> a -> a
#
value(%++) :: Lens a [b] -> b -> a -> a
#

Append b to [b]

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

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

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

This is a version of flip id, where id is specialized from a -> a to (a -> b) -> (a -> b) which by the associativity of (->) is (a -> b) -> a -> b. flipping this yields a -> (a -> b) -> b which is the type signature of &

Examples
Example1 expression
5 & (+1) & show"6"
Example1 expression
sqrt $ [1 / n^2 | n <- [1..1000]] & sum & (*6)3.1406380562059946