Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Annotations.F.Positional
Description
Queries on trees annotated with position information.
- selectByRange :: Foldable f => Range -> AnnFix Bounds f -> Maybe (Zipper (AnnFix Bounds f))
- selectByPos :: Foldable f => Int -> AnnFix Bounds f -> Maybe (Zipper (AnnFix Bounds f))
- validBounds :: Foldable f => AnnFix Bounds f -> [Bounds]
- repairBy :: (Foldable f, Ord dist) => (Range -> Range -> dist) -> AnnFix Bounds f -> Range -> Bounds
- repair :: Foldable f => AnnFix Bounds f -> Range -> Bounds
- moveSelection :: Foldable f => AnnFix Bounds f -> Nav -> Range -> Maybe Bounds
Documentation
selectByRange :: Foldable f => Range -> AnnFix Bounds f -> Maybe (Zipper (AnnFix Bounds f)) Source #
Find the deepest node whose bounds match the given range. See rangeInBounds
.
selectByPos :: Foldable f => Int -> AnnFix Bounds f -> Maybe (Zipper (AnnFix Bounds f)) Source #
Find the deepest node whose bounds contain the given position.
validBounds :: Foldable f => AnnFix Bounds f -> [Bounds] Source #
Find all selections in the tree and return their bounds. The tree is traversed in preorder. Consequently, the bounds are returned in lexicographical order.
repairBy :: (Foldable f, Ord dist) => (Range -> Range -> dist) -> AnnFix Bounds f -> Range -> Bounds Source #
repairBy cost tree range
finds the the closest valid text selection to range
, where 'closest'
is determined by the specified cost function.