HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleproto-lens-0.7.1.5Haskell2010

Data.ProtoLens.Prism

This module defines the Prism type and combinators. Used for building Prisms for oneof fields.

  • 3 types
  • 7 values
valueprism :: (b -> t) -> (s -> Either t a) -> Prism s t a b
#

Build a Control.Lens.Prism.Prism.

Either t a is used instead of Maybe a to permit the types of s and t to differ.

valueprism' :: (b -> s) -> (s -> Maybe a) -> Prism s s a b
#

This is usually used to build a Prism', when you have to use an operation like cast which already returns a Maybe.