cabal-fmt-0.1.5: Format .cabal files

LicenseGPL-3.0-or-later
Safe HaskellNone
LanguageHaskell2010

CabalFmt.Comments

Description

Copyright: Oleg Grenrus

Synopsis

Documentation

newtype Comments Source #

Constructors

Comments [ByteString] 
Instances
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 

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