Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

- data Zipper a = LZ {
- past :: E.NonEmpty a
- future :: [a]

- present :: Zipper a -> a
- integrate' :: Zipper a -> E.NonEmpty a
- integrate :: Zipper a -> [a]
- differentiate :: E.NonEmpty a -> Zipper a
- back :: Zipper a -> Zipper a
- fwd :: Zipper a -> Zipper a
- modifyPresent :: (a -> a) -> Zipper a -> Zipper a
- modifyBack :: ([a] -> [a]) -> Zipper a -> Zipper a
- modifyFwd :: ([a] -> [a]) -> Zipper a -> Zipper a
- delete :: Zipper a -> Zipper a
- insback :: a -> Zipper a -> Zipper a
- insfwd :: a -> Zipper a -> Zipper a

# Documentation

integrate' :: Zipper a -> E.NonEmpty a Source #

Re-constitute a list from a zipper context.

differentiate :: E.NonEmpty a -> Zipper a Source #

Turn a list into a context with the focus on the first element.

back :: Zipper a -> Zipper a Source #

Move the focus to the previous element. Do nothing if the focus | is already on the first element.

fwd :: Zipper a -> Zipper a Source #

Move the focus to the next element. Do nothing if the focus is | already on the last element.

modifyPresent :: (a -> a) -> Zipper a -> Zipper a Source #

Apply the given function to the currently focused element to | produce a new currently focused element.

modifyBack :: ([a] -> [a]) -> Zipper a -> Zipper a Source #

Apply the given function to all elements preceding the focus.

modifyFwd :: ([a] -> [a]) -> Zipper a -> Zipper a Source #

Apply the given function to all elements after the focus.

delete :: Zipper a -> Zipper a Source #

Delete the currently focused element. If there are no future elements move the focus to the next last element.