HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

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.

Contents
  1. Create a zipper and get back the value
  2. Navigate within a zipper
  3. Manipulate the zipper hole
Synopsis
  • Packageuniplate-1.6.13
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceZipper.hs

Create a zipper and get back the value

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

Manipulate the zipper hole

valuehole :: Zipper from to -> to

Retrieve the current focus of the zipper..