language-ninja-0.1.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.Ninja

Contents

Description

This module contains a type representing a parsed Ninja file AST, along with any supporting or related types.

Since: 0.1.0

Synopsis

Ninja

data Ninja ann Source #

A parsed Ninja file.

Since: 0.1.0

Instances

Functor Ninja Source # 

Methods

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

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

Foldable Ninja Source # 

Methods

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

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

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

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

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

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

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

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

toList :: Ninja a -> [a] #

null :: Ninja a -> Bool #

length :: Ninja a -> Int #

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

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

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

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

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

Traversable Ninja Source # 

Methods

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

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

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

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

Annotated Ninja Source #

The usual definition for Annotated.

Since: 0.1.0

Methods

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

(Monad m, NinjaConstraint (Serial m) ann) => Serial m (Ninja ann) Source #

Default Serial instance via Generic.

Since: 0.1.0

Methods

series :: Series m (Ninja ann) #

(Monad m, NinjaConstraint (CoSerial m) ann) => CoSerial m (Ninja ann) Source #

Default CoSerial instance via Generic.

Since: 0.1.0

Methods

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

Eq ann => Eq (Ninja ann) Source # 

Methods

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

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

Show ann => Show (Ninja ann) Source # 

Methods

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

show :: Ninja ann -> String #

showList :: [Ninja ann] -> ShowS #

Generic (Ninja ann) Source # 

Associated Types

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

Methods

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

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

Arbitrary ann => Arbitrary (Ninja ann) Source #

Reasonable Arbitrary instance for Ninja.

Since: 0.1.0

Methods

arbitrary :: Gen (Ninja ann) #

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

Hashable ann => Hashable (Ninja ann) Source #

Default Hashable instance via Generic.

Since: 0.1.0

Methods

hashWithSalt :: Int -> Ninja ann -> Int #

hash :: Ninja ann -> Int #

ToJSON ann => ToJSON (Ninja ann) Source #

Converts to {ann: …, rules: …, singles: …, multiples: …, phonys: …, defaults: …, pools: …, specials: …}.

Since: 0.1.0

Methods

toJSON :: Ninja ann -> Value #

toEncoding :: Ninja ann -> Encoding #

toJSONList :: [Ninja ann] -> Value #

toEncodingList :: [Ninja ann] -> Encoding #

FromJSON ann => FromJSON (Ninja ann) Source #

Inverse of the ToJSON instance.

Since: 0.1.0

Methods

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

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

NFData ann => NFData (Ninja ann) Source #

Default NFData instance via Generic.

Since: 0.1.0

Methods

rnf :: Ninja ann -> () #

type Rep (Ninja ann) Source # 

makeNinja :: Monoid ann => Ninja ann Source #

Construct a Ninja with all default values

Since: 0.1.0

ninjaRules :: Lens' (Ninja ann) (HashMap Text (Rule ann)) Source #

The rules defined in a parsed Ninja file.

Since: 0.1.0

ninjaSingles :: Lens' (Ninja ann) (HashMap Text (Build ann)) Source #

The set of build declarations with precisely one output.

Since: 0.1.0

ninjaMultiples :: Lens' (Ninja ann) (HashMap Outputs (Build ann)) Source #

The set of build declarations with two or more outputs.

Since: 0.1.0

ninjaPhonys :: Lens' (Ninja ann) (HashMap Text (HashSet Text)) Source #

The set of phony build declarations.

Since: 0.1.0

ninjaDefaults :: Lens' (Ninja ann) (HashSet Text) Source #

The set of default targets.

Since: 0.1.0

ninjaPools :: Lens' (Ninja ann) (HashMap Text Int) Source #

A mapping from pool names to pool depth integers.

Since: 0.1.0

ninjaSpecials :: Lens' (Ninja ann) (HashMap Text Text) Source #

A map from "special" top-level variables to their values.

Since: 0.1.0

type NinjaConstraint c ann = (BuildConstraint c ann, c (HashMap (HashSet Text) (Build ann)), c (HashMap Text (HashSet Text)), c (HashMap Text (Rule ann)), c (HashMap Text (Build ann)), c (HashMap Text Int), c ann) Source #

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

Since: 0.1.0

type Outputs = HashSet Output Source #

A type representing the set of outputs for a build declaration with multiple outputs.

Since: 0.1.0

type Output = Text Source #

A type representing an output of a build declaration.

Since: 0.1.0