Safe Haskell | None |
---|---|

Language | Haskell2010 |

## Synopsis

- data Age
- data Tracked (age :: Age) a
- unTrack :: Tracked age a -> a
- data PositionMap (from :: Age) (to :: Age)
- data TrackedStale a where
- TrackedStale :: Tracked (Stale s) a -> PositionMap (Stale s) Current -> TrackedStale a

- untrackedStaleValue :: TrackedStale a -> a
- unsafeMkStale :: age -> Tracked (Stale s) age
- unsafeMkCurrent :: age -> Tracked 'Current age
- unsafeCopyAge :: Tracked age a -> b -> Tracked age b
- class MapAge a where
- mapAgeFrom :: PositionMap from to -> Tracked to a -> Maybe (Tracked from a)
- mapAgeTo :: PositionMap from to -> Tracked from a -> Maybe (Tracked to a)

- dualPositionMap :: PositionMap from to -> PositionMap to from
- useWithStale :: IdeRule k v => k -> NormalizedFilePath -> Action (Maybe (TrackedStale v))
- useWithStale_ :: IdeRule k v => k -> NormalizedFilePath -> Action (TrackedStale v)

# Documentation

A data kind for `Tracked`

.

#### Instances

Category PositionMap Source # | |

Defined in Development.IDE.Core.UseStale 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

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

Like `PositionMapping`

, but with annotated ages for how `Tracked`

values
change. Use the `Category`

instance to compose `PositionMapping`

s in order
to transform between values of different stale ages.

#### Instances

Category PositionMap Source # | |

Defined in Development.IDE.Core.UseStale 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

value, as well as
a `Tracked`

`Stale`

`PositionMapping`

that will fast-forward values to the current age.

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

#### Instances

Functor TrackedStale Source # | |

Defined in Development.IDE.Core.UseStale fmap :: (a -> b) -> TrackedStale a -> TrackedStale b # (<$) :: a -> TrackedStale b -> TrackedStale a # |

untrackedStaleValue :: TrackedStale a -> a Source #

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

unsafeMkCurrent :: age -> Tracked 'Current age Source #

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

A class for which `Tracked`

values can be run across a `PositionMapping`

to change their ages.

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

MapAge RealSrcSpan Source # | |

Defined in Development.IDE.Core.UseStale 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 # | |

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.