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

Moduleoptics-core-0.4.1.1Haskell2010

Optics.Operators

Defines some infix operators for optics operations. This is a deliberately small collection.

If you like operators, you may also wish to import Optics.State.Operators from the optics-extra package.

  • 10 values
value(?~) :: Is k A_Setter => Optic k is s t a (Maybe b) -> b -> s -> t
#

Set the target of a Setter to Just a value.

o ?~ b ≡ set o (Just b)
Example1 expression
Nothing & equality ?~ 'x'Just 'x'
Example1 expression
Map.empty & at 3 ?~ 'x'fromList [(3,'x')]