hls-graph-1.6.0.0: Haskell Language Server internal graph API
Safe HaskellNone
LanguageHaskell2010

Development.IDE.Graph.Rule

Synopsis

Defining builtin rules

Functions and types for defining new types of Shake rules.

addRule :: forall key value. (RuleResult key ~ value, Typeable key, Hashable key, Eq key, Typeable value) => (key -> Maybe ByteString -> RunMode -> Action (RunResult value)) -> Rules () Source #

data RunMode Source #

What mode a rule is running in, passed as an argument to BuiltinRun.

Constructors

RunDependenciesSame

My dependencies have not changed.

RunDependenciesChanged

At least one of my dependencies from last time have changed, or I have no recorded dependencies.

Instances

Instances details
Eq RunMode Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

Methods

(==) :: RunMode -> RunMode -> Bool #

(/=) :: RunMode -> RunMode -> Bool #

Show RunMode Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

NFData RunMode Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

Methods

rnf :: RunMode -> () #

data RunChanged Source #

How the output of a rule has changed.

Constructors

ChangedNothing

Nothing has changed.

ChangedStore

The stored value has changed, but in a way that should be considered identical (used rarely).

ChangedRecomputeSame

I recomputed the value and it was the same.

ChangedRecomputeDiff

I recomputed the value and it was different.

Instances

Instances details
Eq RunChanged Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

Show RunChanged Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

Generic RunChanged Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

Associated Types

type Rep RunChanged :: Type -> Type #

ToJSON RunChanged Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

FromJSON RunChanged Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

NFData RunChanged Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

Methods

rnf :: RunChanged -> () #

type Rep RunChanged Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

type Rep RunChanged = D1 ('MetaData "RunChanged" "Development.IDE.Graph.Internal.Types" "hls-graph-1.6.0.0-J27SBNqlZk27VJG7bp4fKy" 'False) ((C1 ('MetaCons "ChangedNothing" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ChangedStore" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ChangedRecomputeSame" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ChangedRecomputeDiff" 'PrefixI 'False) (U1 :: Type -> Type)))

data RunResult value Source #

The result of BuiltinRun.

Constructors

RunResult 

Fields

Instances

Instances details
Functor RunResult Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

Methods

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

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

NFData value => NFData (RunResult value) Source # 
Instance details

Defined in Development.IDE.Graph.Internal.Types

Methods

rnf :: RunResult value -> () #

Calling builtin rules

Wrappers around calling Shake rules. In general these should be specialised to a builtin rule.

apply :: (RuleResult key ~ value, ShakeValue key, Typeable value) => [key] -> Action [value] Source #

apply1 :: (RuleResult key ~ value, ShakeValue key, Typeable value) => key -> Action value Source #