Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
A map that allows fast "in-range" filtering. RangeMap
is meant
to be constructed once and cached as part of a Shake rule. If
not, the map will be rebuilt upon each invocation, yielding slower
results compared to the list-based approach!
Note that RangeMap
falls back to the list-based approach if
`use-fingertree` flag of `hls-plugin-api` is set to false.
Synopsis
- newtype RangeMap a = RangeMap {
- unRangeMap :: IntervalMap Position a
- fromList :: (a -> Range) -> [a] -> RangeMap a
- fromList' :: [(Range, a)] -> RangeMap a
- filterByRange :: Range -> RangeMap a -> [a]
Documentation
A map from code ranges to values.
RangeMap | |
|
Instances
Foldable RangeMap Source # | |
Defined in Ide.Plugin.RangeMap fold :: Monoid m => RangeMap m -> m # foldMap :: Monoid m => (a -> m) -> RangeMap a -> m # foldMap' :: Monoid m => (a -> m) -> RangeMap a -> m # foldr :: (a -> b -> b) -> b -> RangeMap a -> b # foldr' :: (a -> b -> b) -> b -> RangeMap a -> b # foldl :: (b -> a -> b) -> b -> RangeMap a -> b # foldl' :: (b -> a -> b) -> b -> RangeMap a -> b # foldr1 :: (a -> a -> a) -> RangeMap a -> a # foldl1 :: (a -> a -> a) -> RangeMap a -> a # elem :: Eq a => a -> RangeMap a -> Bool # maximum :: Ord a => RangeMap a -> a # minimum :: Ord a => RangeMap a -> a # | |
Traversable RangeMap Source # | |
Functor RangeMap Source # | |
Monoid (RangeMap a) Source # | |
Semigroup (RangeMap a) Source # | |
NFData a => NFData (RangeMap a) Source # | |
Defined in Ide.Plugin.RangeMap |
fromList :: (a -> Range) -> [a] -> RangeMap a Source #
Construct a RangeMap
from a Range
accessor and a list of values.
filterByRange :: Range -> RangeMap a -> [a] Source #
Filter a RangeMap
by a given Range
.