HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduleoptics-core-0.4.2Haskell2010

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
  • Packageoptics-core-0.4.2
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceOperators.hs
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')]