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

Moduleuniplate-1.6.13Haskell2010

Data.Generics.Uniplate.Zipper

A zipper is a structure for walking a value and manipulating it in constant time.

This module was inspired by the paper: Michael D. Adams. Scrap Your Zippers: A Generic Zipper for Heterogeneous Types, Workshop on Generic Programming 2010.

  • 1 type
  • 9 values
  • Packageuniplate-1.6.13
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceZipper.hs

Create a zipper and get back the value

4 declarations
datadata Zipper from to
#

Zipper structure, whose root type is the first type argument, and whose focus type is the second type argument.

Instances1Eq
  • (Eq from, Eq to) => Eq (Zipper from to)Defined in uniplate-1.6.13 · Data.Generics.Uniplate.Zipper
valuezipperBi :: Biplate from to => from -> Maybe (Zipper from to)
#

Create a zipper with a different focus type from the outer type. Will return Nothing if there are no instances of the focus type within the original value.

valuefromZipper :: Zipper from to -> from
#

From a zipper take the whole structure, including any modifications.

Navigate within a zipper

4 declarations
valueup :: Zipper from to -> Maybe (Zipper from to)
#

Move one step up from the current position.

Manipulate the zipper hole

2 declarations
valuehole :: Zipper from to -> to
#

Retrieve the current focus of the zipper..