Annotations-0.2.2: Constructing, analyzing and destructing annotated trees

Safe HaskellSafe
LanguageHaskell98

Annotations.MultiRec.Positional

Synopsis

Documentation

selectByRange :: Zipper phi (PF phi) => phi ix -> Range -> AnnFix Bounds phi ix -> Maybe (AnnZipper phi Bounds ix) Source #

Find the deepest node whose bounds match the given range. See rangeInBounds.

selectByPos :: Zipper phi (PF phi) => phi ix -> Int -> AnnFix Bounds phi ix -> Maybe (AnnZipper phi Bounds ix) Source #

repairBy :: (Ord dist, HFunctor phi (PF phi)) => phi ix -> (Range -> Range -> dist) -> AnnFix Bounds phi ix -> Range -> Bounds Source #

repair :: HFunctor phi (PF phi) => phi ix -> AnnFix Bounds phi ix -> Range -> Bounds Source #

Defined as repairBy distRange.

sortOn :: Ord b => (a -> b) -> [a] -> [a] Source #

moveSelection :: Zipper phi (PF phi) => phi ix -> AnnFix Bounds phi ix -> Nav -> Range -> Maybe Bounds Source #

Move around in a tree according to the Nav, expressed in tree selections. Although a Range is required as input, a Bounds is returned, providing information about all the valid text selections that would select the particular tree node.