language-ninja-0.2.0: A library for dealing with the Ninja build language.

CopyrightCopyright 2017 Awake Security
LicenseApache-2.0
Maintaineropensource@awakesecurity.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Language.Ninja.AST.Rule

Description

This module contains a type representing a rule declaration in the parsed Ninja AST, along with any supporting or related types.

Since: 0.1.0

Synopsis

Documentation

data Rule ann Source #

A parsed Ninja rule declaration.

Since: 0.1.0

Instances

Functor Rule Source # 

Methods

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

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

Foldable Rule Source # 

Methods

fold :: Monoid m => Rule m -> m #

foldMap :: Monoid m => (a -> m) -> Rule a -> m #

foldr :: (a -> b -> b) -> b -> Rule a -> b #

foldr' :: (a -> b -> b) -> b -> Rule a -> b #

foldl :: (b -> a -> b) -> b -> Rule a -> b #

foldl' :: (b -> a -> b) -> b -> Rule a -> b #

foldr1 :: (a -> a -> a) -> Rule a -> a #

foldl1 :: (a -> a -> a) -> Rule a -> a #

toList :: Rule a -> [a] #

null :: Rule a -> Bool #

length :: Rule a -> Int #

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

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

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

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

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

Traversable Rule Source # 

Methods

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

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

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

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

Annotated Rule Source #

The usual definition for Annotated.

Since: 0.1.0

Methods

annotation' :: (ann -> ann') -> Lens (Rule ann) (Rule ann') ann ann' Source #

(Monad m, RuleConstraint (Serial m) ann) => Serial m (Rule ann) Source #

Default Serial instance via Generic.

Since: 0.1.0

Methods

series :: Series m (Rule ann) #

(Monad m, RuleConstraint (CoSerial m) ann) => CoSerial m (Rule ann) Source #

Default CoSerial instance via Generic.

Since: 0.1.0

Methods

coseries :: Series m b -> Series m (Rule ann -> b) #

Eq ann => Eq (Rule ann) Source # 

Methods

(==) :: Rule ann -> Rule ann -> Bool #

(/=) :: Rule ann -> Rule ann -> Bool #

Show ann => Show (Rule ann) Source # 

Methods

showsPrec :: Int -> Rule ann -> ShowS #

show :: Rule ann -> String #

showList :: [Rule ann] -> ShowS #

Generic (Rule ann) Source # 

Associated Types

type Rep (Rule ann) :: * -> * #

Methods

from :: Rule ann -> Rep (Rule ann) x #

to :: Rep (Rule ann) x -> Rule ann #

(Arbitrary ann, RuleConstraint Arbitrary ann) => Arbitrary (Rule ann) Source #

Reasonable Arbitrary instance for Rule.

Since: 0.2.0

Methods

arbitrary :: Gen (Rule ann) #

shrink :: Rule ann -> [Rule ann] #

Hashable ann => Hashable (Rule ann) Source #

Default Hashable instance via Generic.

Since: 0.1.0

Methods

hashWithSalt :: Int -> Rule ann -> Int #

hash :: Rule ann -> Int #

ToJSON ann => ToJSON (Rule ann) Source #

Converts to {ann: …, bind: …}.

Since: 0.1.0

Methods

toJSON :: Rule ann -> Value #

toEncoding :: Rule ann -> Encoding #

toJSONList :: [Rule ann] -> Value #

toEncodingList :: [Rule ann] -> Encoding #

FromJSON ann => FromJSON (Rule ann) Source #

Inverse of the ToJSON instance.

Since: 0.1.0

Methods

parseJSON :: Value -> Parser (Rule ann) #

parseJSONList :: Value -> Parser [Rule ann] #

NFData ann => NFData (Rule ann) Source #

Default NFData instance via Generic.

Since: 0.1.0

Methods

rnf :: Rule ann -> () #

type Rep (Rule ann) Source # 
type Rep (Rule ann) = D1 (MetaData "Rule" "Language.Ninja.AST.Rule" "language-ninja-0.2.0-4aVVODOvkNMFxGcRpnztag" False) (C1 (MetaCons "MkRule" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_ruleAnn") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ann)) (S1 (MetaSel (Just Symbol "_ruleBind") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (HashMap Text (Expr ann))))))

makeRule :: Monoid ann => Rule ann Source #

Construct a Rule with all default values

Since: 0.1.0

ruleBind :: Lens' (Rule ann) (HashMap Text (Expr ann)) Source #

The set of bindings in scope during the execution of this rule.

Since: 0.1.0

type RuleConstraint c ann = (c (HashMap Text (Expr ann)), c ann) Source #

The set of constraints required for a given constraint to be automatically computed for a Rule.

Since: 0.1.0