Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Field ann
- fieldName :: Field ann -> Name ann
- fieldAnn :: Field ann -> ann
- fieldUniverse :: Field ann -> [Field ann]
- data FieldLine ann = FieldLine !ann !ByteString
- fieldLineAnn :: FieldLine ann -> ann
- fieldLineBS :: FieldLine ann -> ByteString
- data SectionArg ann
- = SecArgName !ann !ByteString
- | SecArgStr !ann !ByteString
- | SecArgOther !ann !ByteString
- sectionArgAnn :: SectionArg ann -> ann
- type FieldName = ByteString
- data Name ann = Name !ann !FieldName
- mkName :: ann -> FieldName -> Name ann
- getName :: Name ann -> FieldName
- nameAnn :: Name ann -> ann
- sectionArgsToString :: [SectionArg ann] -> String
- fieldLinesToString :: [FieldLine ann] -> String
Cabal file
A Cabal-like file consists of a series of fields (foo: bar
) and sections (library ...
).
Instances
Foldable1 Field Source # | Since: Cabal-syntax-3.12.0.0 |
Defined in Distribution.Fields.Field fold1 :: Semigroup m => Field m -> m Source # foldMap1 :: Semigroup m => (a -> m) -> Field a -> m Source # foldMap1' :: Semigroup m => (a -> m) -> Field a -> m Source # toNonEmpty :: Field a -> NonEmpty a Source # maximum :: Ord a => Field a -> a Source # minimum :: Ord a => Field a -> a Source # foldrMap1 :: (a -> b) -> (a -> b -> b) -> Field a -> b Source # foldlMap1' :: (a -> b) -> (b -> a -> b) -> Field a -> b Source # foldlMap1 :: (a -> b) -> (b -> a -> b) -> Field a -> b Source # foldrMap1' :: (a -> b) -> (a -> b -> b) -> Field a -> b Source # | |
Functor Field Source # | |
Foldable Field Source # | |
Defined in Distribution.Fields.Field fold :: Monoid m => Field m -> m # foldMap :: Monoid m => (a -> m) -> Field a -> m # foldMap' :: Monoid m => (a -> m) -> Field a -> m # foldr :: (a -> b -> b) -> b -> Field a -> b # foldr' :: (a -> b -> b) -> b -> Field a -> b # foldl :: (b -> a -> b) -> b -> Field a -> b # foldl' :: (b -> a -> b) -> b -> Field a -> b # foldr1 :: (a -> a -> a) -> Field a -> a # foldl1 :: (a -> a -> a) -> Field a -> a # elem :: Eq a => a -> Field a -> Bool # maximum :: Ord a => Field a -> a # minimum :: Ord a => Field a -> a # | |
Traversable Field Source # | |
Show ann => Show (Field ann) Source # | |
Eq ann => Eq (Field ann) Source # | |
Ord ann => Ord (Field ann) Source # | Since: Cabal-syntax-3.12.0.0 |
Defined in Distribution.Fields.Field |
fieldUniverse :: Field ann -> [Field ann] Source #
All transitive descendants of Field
, including itself.
Note: the resulting list is never empty.
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.
FieldLine !ann !ByteString |
Instances
fieldLineAnn :: FieldLine ann -> ann Source #
Since: Cabal-syntax-3.0.0.0
fieldLineBS :: FieldLine ann -> ByteString Source #
Since: Cabal-syntax-3.0.0.0
data SectionArg ann Source #
Section arguments, e.g. name of the library
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
sectionArgAnn :: SectionArg ann -> ann Source #
Extract annotation from SectionArg
.
Name
type FieldName = ByteString Source #
A field name.
Invariant: ByteString
is lower-case ASCII.
Instances
Foldable1 Name Source # | Since: Cabal-syntax-3.12.0.0 |
Defined in Distribution.Fields.Field fold1 :: Semigroup m => Name m -> m Source # foldMap1 :: Semigroup m => (a -> m) -> Name a -> m Source # foldMap1' :: Semigroup m => (a -> m) -> Name a -> m Source # toNonEmpty :: Name a -> NonEmpty a Source # maximum :: Ord a => Name a -> a Source # minimum :: Ord a => Name a -> a Source # foldrMap1 :: (a -> b) -> (a -> b -> b) -> Name a -> b Source # foldlMap1' :: (a -> b) -> (b -> a -> b) -> Name a -> b Source # foldlMap1 :: (a -> b) -> (b -> a -> b) -> Name a -> b Source # foldrMap1' :: (a -> b) -> (a -> b -> b) -> Name a -> b Source # | |
Functor Name Source # | |
Foldable Name Source # | |
Defined in Distribution.Fields.Field fold :: Monoid m => Name m -> m # foldMap :: Monoid m => (a -> m) -> Name a -> m # foldMap' :: Monoid m => (a -> m) -> Name a -> m # foldr :: (a -> b -> b) -> b -> Name a -> b # foldr' :: (a -> b -> b) -> b -> Name a -> b # foldl :: (b -> a -> b) -> b -> Name a -> b # foldl' :: (b -> a -> b) -> b -> Name a -> b # foldr1 :: (a -> a -> a) -> Name a -> a # foldl1 :: (a -> a -> a) -> Name a -> a # elem :: Eq a => a -> Name a -> Bool # maximum :: Ord a => Name a -> a # | |
Traversable Name Source # | |
Show ann => Show (Name ann) Source # | |
Eq ann => Eq (Name ann) Source # | |
Ord ann => Ord (Name ann) Source # | Since: Cabal-syntax-3.12.0.0 |
Defined in Distribution.Fields.Field |
Conversions to String
sectionArgsToString :: [SectionArg ann] -> String Source #
Since: Cabal-syntax-3.6.0.0