cabal-fmt-0.1.5.1: Format .cabal files
CopyrightOleg Grenrus
LicenseGPL-3.0-or-later
Safe HaskellNone
LanguageHaskell2010

CabalFmt.Comments

Description

 
Synopsis

Documentation

newtype Comments Source #

Constructors

Comments [ByteString] 

Instances

Instances details
Show Comments Source # 
Instance details

Defined in CabalFmt.Comments

Semigroup Comments Source # 
Instance details

Defined in CabalFmt.Comments

Monoid Comments Source # 
Instance details

Defined in CabalFmt.Comments

attachComments Source #

Arguments

:: ByteString

source with comments

-> [Field Position]

parsed source fields

-> ([Field Comments], Comments) 

Returns a Field forest with comments attached.

  • Comments are attached to the field after it.
  • A glitch: comments "inside" the field are attached to the field after it.
  • End-of-file comments are returned separately.

overAnn :: forall a b. (FieldPath -> a -> b) -> [Field a] -> [Field b] Source #

data FieldPath Source #

Paths input paths. Essentially a list of offsets. Own type ofr safety.

Constructors

End 
Nth Int FieldPath 

Instances

Instances details
Eq FieldPath Source # 
Instance details

Defined in CabalFmt.Comments

Ord FieldPath Source # 
Instance details

Defined in CabalFmt.Comments

Show FieldPath Source # 
Instance details

Defined in CabalFmt.Comments

findPath :: (a -> Position) -> Int -> [(FieldPath, a)] -> Maybe FieldPath Source #