Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module should be imported qualified due to the very short names it exports.
Synopsis
- data DirZipper a = DirZipper {
- _dirZipper_cursor :: DirTree a
- _dirZipper_siblings :: Map FilePath (DirTree a)
- _dirZipper_elders :: [(DirTree a, Map FilePath (DirTree a))]
- zipped :: DirTree a -> DirZipper a
- focused :: DirZipper a -> DirTree a
- unzipped :: DirZipper a -> DirTree a
- down :: DirZipper a -> Maybe (DirZipper a)
- up :: DirZipper a -> Maybe (DirZipper a)
- home :: DirZipper a -> DirZipper a
- data NavSibling
- nextSibling :: NavSibling -> DirZipper a -> Maybe (DirZipper a)
- left :: DirZipper a -> Maybe (DirZipper a)
- right :: DirZipper a -> Maybe (DirZipper a)
- toSibling :: FileName -> DirZipper a -> Maybe (DirZipper a)
- downTo :: FileName -> DirZipper a -> Maybe (DirZipper a)
- mapCursor :: (DirTree a -> DirTree a) -> DirZipper a -> DirZipper a
- replaceCursor :: DirTree a -> DirZipper a -> DirZipper a
- insert :: DirTree a -> DirZipper a -> DirZipper a
- remove :: DirZipper a -> Maybe (DirZipper a)
- followRelative :: FilePath -> DirZipper a -> Maybe (DirZipper a)
- followLink :: DirZipper a -> Maybe (DirZipper a)
Zipper
A zipper for a DirTree
. As you navigate the tree, this keeps track of where
you are (which node is "focused" under your cursor) and how to reach parent, child,
and sibling nodes.
DirZipper | |
|
Instances
Eq a => Eq (DirZipper a) Source # | |
Ord a => Ord (DirZipper a) Source # | |
Defined in System.Directory.Contents.Zipper | |
Read a => Read (DirZipper a) Source # | |
Show a => Show (DirZipper a) Source # | |
focused :: DirZipper a -> DirTree a Source #
The currently focused/selected node (and its children). In other words, where you are in the directory hierarchy.
down :: DirZipper a -> Maybe (DirZipper a) Source #
Move down a level in the directory hierarchy. To move down to a specific child,
use downTo
.
up :: DirZipper a -> Maybe (DirZipper a) Source #
Move up a level in the directory hierarchy, back to the parent that you
previously moved down
through.
nextSibling :: NavSibling -> DirZipper a -> Maybe (DirZipper a) Source #
Move to the sibling next to the focused node
left :: DirZipper a -> Maybe (DirZipper a) Source #
Move to the sibling to the left of the focused node
right :: DirZipper a -> Maybe (DirZipper a) Source #
Move to the sibling to the right of the focused node
downTo :: FileName -> DirZipper a -> Maybe (DirZipper a) Source #
Move down in the directory hierarchy to a particular child
insert :: DirTree a -> DirZipper a -> DirZipper a Source #
Add a new sibling to the focused node's generation and focus on it