ghcide-1.2.0.2: The core of an IDE
Safe HaskellNone
LanguageHaskell2010

Development.IDE.Core.UseStale

Synopsis

Documentation

data Age Source #

A data kind for Tracked.

Constructors

Current 
Stale Type 

Instances

Instances details
Category PositionMap Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

id :: forall (a :: k). PositionMap a a #

(.) :: forall (b :: k) (c :: k) (a :: k). PositionMap b c -> PositionMap a b -> PositionMap a c #

data Tracked (age :: Age) a Source #

Some value, tagged with its age. All Current ages are considered to be the same thing, but Stale values are protected by an untouchable variable to ensure they can't be unified.

Instances

Instances details
Monad (Tracked age) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

(>>=) :: Tracked age a -> (a -> Tracked age b) -> Tracked age b #

(>>) :: Tracked age a -> Tracked age b -> Tracked age b #

return :: a -> Tracked age a #

Functor (Tracked age) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

fmap :: (a -> b) -> Tracked age a -> Tracked age b #

(<$) :: a -> Tracked age b -> Tracked age a #

Applicative (Tracked age) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

pure :: a -> Tracked age a #

(<*>) :: Tracked age (a -> b) -> Tracked age a -> Tracked age b #

liftA2 :: (a -> b -> c) -> Tracked age a -> Tracked age b -> Tracked age c #

(*>) :: Tracked age a -> Tracked age b -> Tracked age b #

(<*) :: Tracked age a -> Tracked age b -> Tracked age a #

Foldable (Tracked age) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

fold :: Monoid m => Tracked age m -> m #

foldMap :: Monoid m => (a -> m) -> Tracked age a -> m #

foldMap' :: Monoid m => (a -> m) -> Tracked age a -> m #

foldr :: (a -> b -> b) -> b -> Tracked age a -> b #

foldr' :: (a -> b -> b) -> b -> Tracked age a -> b #

foldl :: (b -> a -> b) -> b -> Tracked age a -> b #

foldl' :: (b -> a -> b) -> b -> Tracked age a -> b #

foldr1 :: (a -> a -> a) -> Tracked age a -> a #

foldl1 :: (a -> a -> a) -> Tracked age a -> a #

toList :: Tracked age a -> [a] #

null :: Tracked age a -> Bool #

length :: Tracked age a -> Int #

elem :: Eq a => a -> Tracked age a -> Bool #

maximum :: Ord a => Tracked age a -> a #

minimum :: Ord a => Tracked age a -> a #

sum :: Num a => Tracked age a -> a #

product :: Num a => Tracked age a -> a #

Traversable (Tracked age) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

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

sequenceA :: Applicative f => Tracked age (f a) -> f (Tracked age a) #

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

sequence :: Monad m => Tracked age (m a) -> m (Tracked age a) #

Eq a => Eq (Tracked age a) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

(==) :: Tracked age a -> Tracked age a -> Bool #

(/=) :: Tracked age a -> Tracked age a -> Bool #

Ord a => Ord (Tracked age a) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

compare :: Tracked age a -> Tracked age a -> Ordering #

(<) :: Tracked age a -> Tracked age a -> Bool #

(<=) :: Tracked age a -> Tracked age a -> Bool #

(>) :: Tracked age a -> Tracked age a -> Bool #

(>=) :: Tracked age a -> Tracked age a -> Bool #

max :: Tracked age a -> Tracked age a -> Tracked age a #

min :: Tracked age a -> Tracked age a -> Tracked age a #

Read a => Read (Tracked age a) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

readsPrec :: Int -> ReadS (Tracked age a) #

readList :: ReadS [Tracked age a] #

readPrec :: ReadPrec (Tracked age a) #

readListPrec :: ReadPrec [Tracked age a] #

Show a => Show (Tracked age a) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

showsPrec :: Int -> Tracked age a -> ShowS #

show :: Tracked age a -> String #

showList :: [Tracked age a] -> ShowS #

ToJSON a => ToJSON (Tracked age a) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

toJSON :: Tracked age a -> Value #

toEncoding :: Tracked age a -> Encoding #

toJSONList :: [Tracked age a] -> Value #

toEncodingList :: [Tracked age a] -> Encoding #

FromJSON a => FromJSON (Tracked age a) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

parseJSON :: Value -> Parser (Tracked age a) #

parseJSONList :: Value -> Parser [Tracked age a] #

NFData a => NFData (Tracked age a) Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

rnf :: Tracked age a -> () #

unTrack :: Tracked age a -> a Source #

data PositionMap (from :: Age) (to :: Age) Source #

Like PositionMapping, but with annotated ages for how Tracked values change. Use the Category instance to compose PositionMappings in order to transform between values of different stale ages.

Instances

Instances details
Category PositionMap Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

id :: forall (a :: k). PositionMap a a #

(.) :: forall (b :: k) (c :: k) (a :: k). PositionMap b c -> PositionMap a b -> PositionMap a c #

data TrackedStale a where Source #

A pair containing a Tracked Stale value, as well as a PositionMapping that will fast-forward values to the current age.

Constructors

TrackedStale :: Tracked (Stale s) a -> PositionMap (Stale s) Current -> TrackedStale a 

Instances

Instances details
Functor TrackedStale Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

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

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

unsafeMkStale :: age -> Tracked (Stale s) age Source #

unsafeCopyAge :: Tracked age a -> b -> Tracked age b Source #

class MapAge a where Source #

A class for which Tracked values can be run across a PositionMapping to change their ages.

Minimal complete definition

mapAgeFrom | mapAgeTo

Methods

mapAgeFrom :: PositionMap from to -> Tracked to a -> Maybe (Tracked from a) Source #

mapAgeTo :: PositionMap from to -> Tracked from a -> Maybe (Tracked to a) Source #

Instances

Instances details
MapAge RealSrcSpan Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

mapAgeFrom :: forall (from :: Age) (to :: Age). PositionMap from to -> Tracked to RealSrcSpan -> Maybe (Tracked from RealSrcSpan) Source #

mapAgeTo :: forall (from :: Age) (to :: Age). PositionMap from to -> Tracked from RealSrcSpan -> Maybe (Tracked to RealSrcSpan) Source #

MapAge Range Source # 
Instance details

Defined in Development.IDE.Core.UseStale

Methods

mapAgeFrom :: forall (from :: Age) (to :: Age). PositionMap from to -> Tracked to Range -> Maybe (Tracked from Range) Source #

mapAgeTo :: forall (from :: Age) (to :: Age). PositionMap from to -> Tracked from Range -> Maybe (Tracked to Range) Source #

dualPositionMap :: PositionMap from to -> PositionMap to from Source #

Get a PositionMap that runs in the opposite direction.

useWithStale :: IdeRule k v => k -> NormalizedFilePath -> Action (Maybe (TrackedStale v)) Source #

Request a Rule result, it not available return the last computed result, if any, which may be stale

useWithStale_ :: IdeRule k v => k -> NormalizedFilePath -> Action (TrackedStale v) Source #

Request a Rule result, it not available return the last computed result which may be stale. Errors out if none available.