hls-graph-2.9.0.0: Haskell Language Server internal graph API

Safe Haskell | None
Language | GHC2021

Development.IDE.Graph

Contents

- Configuration
- Explicit parallelism
- Oracle rules
- Special rules
- Actions for inspecting the keys in the database

Synopsis

- shakeOptions :: ShakeOptions
- data Rules a
- data Action a
- action :: Action a -> Rules ()
- pattern Key :: () => (Typeable a, Hashable a, Show a) => a -> Key
- newKey :: (Typeable a, Hashable a, Show a) => a -> Key
- renderKey :: Key -> Text
- actionFinally :: Action a -> IO b -> Action a
- actionBracket :: IO a -> (a -> IO b) -> (a -> Action c) -> Action c
- actionCatch :: Exception e => Action a -> (e -> Action a) -> Action a
- actionFork :: Action a -> (Async a -> Action b) -> Action b
- data ShakeOptions
- getShakeExtra :: Typeable a => Action (Maybe a)
- getShakeExtraRules :: Typeable a => Rules (Maybe a)
- newShakeExtra :: Typeable a => a -> Maybe Dynamic
- parallel :: [Action a] -> Action [a]
- type ShakeValue a = (Show a, Typeable a, Eq a, Hashable a, NFData a)
- type family RuleResult key
- alwaysRerun :: Action ()
- getDirtySet :: Action [(Key, Int)]
- getKeysAndVisitedAge :: Action [(Key, Int)]
- module Development.IDE.Graph.KeyMap
- module Development.IDE.Graph.KeySet

# Documentation

shakeOptions :: ShakeOptions #

data Rules a #

A computation that defines all the rules that form part of the computation graph.

`Rules` has access to `IO` through `MonadIO`. Use of `IO` is at your own risk: if you write `Rules` that throw exceptions, then you need to make sure to handle them yourself when you run the resulting `Rules`.

#### Instances

Instances details

MonadIO Rules # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods liftIO :: IO a -> Rules a #
Applicative Rules # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods pure :: a -> Rules a # (<*>) :: Rules (a -> b) -> Rules a -> Rules b # liftA2 :: (a -> b -> c) -> Rules a -> Rules b -> Rules c # (*>) :: Rules a -> Rules b -> Rules b # (<*) :: Rules a -> Rules b -> Rules a #
Functor Rules # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods fmap :: (a -> b) -> Rules a -> Rules b # (<$) :: a -> Rules b -> Rules a #
Monad Rules # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods (>>=) :: Rules a -> (a -> Rules b) -> Rules b # (>>) :: Rules a -> Rules b -> Rules b # return :: a -> Rules a #
Monoid a => Monoid (Rules a) # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods mempty :: Rules a # mappend :: Rules a -> Rules a -> Rules a # mconcat :: [Rules a] -> Rules a #
Semigroup a => Semigroup (Rules a) # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods (<>) :: Rules a -> Rules a -> Rules a # sconcat :: NonEmpty (Rules a) -> Rules a # stimes :: Integral b => b -> Rules a -> Rules a #

data Action a #

An action representing something that can be run as part of a `Rule`.

`Action`s can be pure functions but also have access to `IO` via `MonadIO` and 'MonadUnliftIO. It should be assumed that actions throw exceptions, these can be caught with `actionCatch`. In particular, it is permissible to use the `MonadFail` instance, which will lead to an `IOException`.

#### Instances

Instances details

MonadIO Action # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods liftIO :: IO a -> Action a #
MonadCatch Action # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods catch :: (HasCallStack, Exception e) => Action a -> (e -> Action a) -> Action a #
MonadMask Action # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods mask :: HasCallStack => ((forall a. Action a -> Action a) -> Action b) -> Action b # uninterruptibleMask :: HasCallStack => ((forall a. Action a -> Action a) -> Action b) -> Action b # generalBracket :: HasCallStack => Action a -> (a -> ExitCase b -> Action c) -> (a -> Action b) -> Action (b, c) #
MonadThrow Action # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods throwM :: (HasCallStack, Exception e) => e -> Action a #
Applicative Action # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods pure :: a -> Action a # (<*>) :: Action (a -> b) -> Action a -> Action b # liftA2 :: (a -> b -> c) -> Action a -> Action b -> Action c # (*>) :: Action a -> Action b -> Action b # (<*) :: Action a -> Action b -> Action a #
Functor Action # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods fmap :: (a -> b) -> Action a -> Action b # (<$) :: a -> Action b -> Action a #
Monad Action # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods (>>=) :: Action a -> (a -> Action b) -> Action b # (>>) :: Action a -> Action b -> Action b # return :: a -> Action a #
MonadFail Action # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods fail :: String -> Action a #
MonadUnliftIO Action # |
Instance details Defined in Development.IDE.Graph.Internal.Types Methods withRunInIO :: ((forall a. Action a -> IO a) -> IO b) -> Action b #

action :: Action a -> Rules () #

pattern Key :: () => (Typeable a, Hashable a, Show a) => a -> Key #

newKey :: (Typeable a, Hashable a, Show a) => a -> Key #

renderKey :: Key -> Text #

actionFinally :: Action a -> IO b -> Action a #

actionBracket :: IO a -> (a -> IO b) -> (a -> Action c) -> Action c #

actionCatch :: Exception e => Action a -> (e -> Action a) -> Action a #

actionFork :: Action a -> (Async a -> Action b) -> Action b #

# Configuration

data ShakeOptions #

getShakeExtra :: Typeable a => Action (Maybe a) #

getShakeExtraRules :: Typeable a => Rules (Maybe a) #

newShakeExtra :: Typeable a => a -> Maybe Dynamic #

# Explicit parallelism

parallel :: [Action a] -> Action [a] #

# Oracle rules

type ShakeValue a = (Show a, Typeable a, Eq a, Hashable a, NFData a) #

type family RuleResult key #

The type mapping between the `key` or a rule and the resulting `value`.

# Special rules

alwaysRerun :: Action () #

Always rerun this rule when dirty, regardless of the dependencies.

# Actions for inspecting the keys in the database

getDirtySet :: Action [(Key, Int)] #

Returns the set of dirty keys annotated with their age (in # of builds)

getKeysAndVisitedAge :: Action [(Key, Int)] #

module Development.IDE.Graph.KeyMap

module Development.IDE.Graph.KeySet