Cabal-3.2.1.0: A framework for packaging Haskell software
Safe Haskell None
Language Haskell2010

Distribution.Fields.Field

Description

Cabal-like file AST types: Field , Section etc

These types are parametrized by an annotation.

Synopsis

Cabal file

data Field ann Source #

A Cabal-like file consists of a series of fields ( foo: bar ) and sections ( library ... ).

Constructors

Field !( Name ann) [ FieldLine ann]
Section !( Name ann) [ SectionArg ann] [ Field ann]

Instances

Instances details
Functor Field Source #
Instance details

Defined in Distribution.Fields.Field

Foldable Field Source #
Instance details

Defined in Distribution.Fields.Field

Traversable Field Source #
Instance details

Defined in Distribution.Fields.Field

Eq ann => Eq ( Field ann) Source #
Instance details

Defined in Distribution.Fields.Field

Show ann => Show ( Field ann) Source #
Instance details

Defined in Distribution.Fields.Field

fieldName :: Field ann -> Name ann Source #

Section of field name

fieldUniverse :: Field ann -> [ Field ann] Source #

All transitive descendants of Field , including itself.

Note: the resulting list is never empty.

data FieldLine ann Source #

A line of text representing the value of a field from a Cabal file. A field may contain multiple lines.

Invariant: ByteString has no newlines.

Constructors

FieldLine !ann ! ByteString

Instances

Instances details
Functor FieldLine Source #
Instance details

Defined in Distribution.Fields.Field

Foldable FieldLine Source #
Instance details

Defined in Distribution.Fields.Field

Traversable FieldLine Source #
Instance details

Defined in Distribution.Fields.Field

Eq ann => Eq ( FieldLine ann) Source #
Instance details

Defined in Distribution.Fields.Field

Show ann => Show ( FieldLine ann) Source #
Instance details

Defined in Distribution.Fields.Field

fieldLineAnn :: FieldLine ann -> ann Source #

Since: 3.0.0.0

data SectionArg ann Source #

Section arguments, e.g. name of the library

Constructors

SecArgName !ann ! ByteString

identifier, or something which looks like number. Also many dot numbers, i.e. "7.6.3"

SecArgStr !ann ! ByteString

quoted string

SecArgOther !ann ! ByteString

everything else, mm. operators (e.g. in if-section conditionals)

Instances

Instances details
Functor SectionArg Source #
Instance details

Defined in Distribution.Fields.Field

Foldable SectionArg Source #
Instance details

Defined in Distribution.Fields.Field

Traversable SectionArg Source #
Instance details

Defined in Distribution.Fields.Field

Eq ann => Eq ( SectionArg ann) Source #
Instance details

Defined in Distribution.Fields.Field

Show ann => Show ( SectionArg ann) Source #
Instance details

Defined in Distribution.Fields.Field

sectionArgAnn :: SectionArg ann -> ann Source #

Extract annotation from SectionArg .

Name

data Name ann Source #

A field name.

Invariant : ByteString is lower-case ASCII.

Constructors

Name !ann ! FieldName

Instances

Instances details
Functor Name Source #
Instance details

Defined in Distribution.Fields.Field

Foldable Name Source #
Instance details

Defined in Distribution.Fields.Field

Traversable Name Source #
Instance details

Defined in Distribution.Fields.Field

Eq ann => Eq ( Name ann) Source #
Instance details

Defined in Distribution.Fields.Field

Show ann => Show ( Name ann) Source #
Instance details

Defined in Distribution.Fields.Field