hls-plugin-api-2.5.0.0: Haskell Language Server API for plugin communication
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ide.Plugin.RangeMap

Description

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

Documentation

newtype RangeMap a Source #

A map from code ranges to values.

Constructors

RangeMap 

Fields

Instances

Instances details
Foldable RangeMap Source # 
Instance details

Defined in Ide.Plugin.RangeMap

Methods

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 #

toList :: RangeMap a -> [a] #

null :: RangeMap a -> Bool #

length :: RangeMap a -> Int #

elem :: Eq a => a -> RangeMap a -> Bool #

maximum :: Ord a => RangeMap a -> a #

minimum :: Ord a => RangeMap a -> a #

sum :: Num a => RangeMap a -> a #

product :: Num a => RangeMap a -> a #

Traversable RangeMap Source # 
Instance details

Defined in Ide.Plugin.RangeMap

Methods

traverse :: Applicative f => (a -> f b) -> RangeMap a -> f (RangeMap b) #

sequenceA :: Applicative f => RangeMap (f a) -> f (RangeMap a) #

mapM :: Monad m => (a -> m b) -> RangeMap a -> m (RangeMap b) #

sequence :: Monad m => RangeMap (m a) -> m (RangeMap a) #

Functor RangeMap Source # 
Instance details

Defined in Ide.Plugin.RangeMap

Methods

fmap :: (a -> b) -> RangeMap a -> RangeMap b #

(<$) :: a -> RangeMap b -> RangeMap a #

Monoid (RangeMap a) Source # 
Instance details

Defined in Ide.Plugin.RangeMap

Methods

mempty :: RangeMap a #

mappend :: RangeMap a -> RangeMap a -> RangeMap a #

mconcat :: [RangeMap a] -> RangeMap a #

Semigroup (RangeMap a) Source # 
Instance details

Defined in Ide.Plugin.RangeMap

Methods

(<>) :: RangeMap a -> RangeMap a -> RangeMap a #

sconcat :: NonEmpty (RangeMap a) -> RangeMap a #

stimes :: Integral b => b -> RangeMap a -> RangeMap a #

NFData a => NFData (RangeMap a) Source # 
Instance details

Defined in Ide.Plugin.RangeMap

Methods

rnf :: RangeMap a -> () #

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.