cabal-fmt-0.1.9: Format .cabal files
CopyrightOleg Grenrus
LicenseGPL-3.0-or-later
Safe HaskellSafe-Inferred
LanguageHaskell2010

CabalFmt.Comments

Description

 
Synopsis

Documentation

newtype Comments #

Constructors

Comments [ByteString] 

Instances

Instances details
Monoid Comments # 
Instance details

Defined in CabalFmt.Comments

Semigroup Comments # 
Instance details

Defined in CabalFmt.Comments

Methods

(<>) :: Comments -> Comments -> Comments

sconcat :: NonEmpty Comments -> Comments

stimes :: Integral b => b -> Comments -> Comments

Show Comments # 
Instance details

Defined in CabalFmt.Comments

Methods

showsPrec :: Int -> Comments -> ShowS

show :: Comments -> String

showList :: [Comments] -> ShowS

attachComments #

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] #

data FieldPath #

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

Constructors

End 
Nth Int FieldPath 

Instances

Instances details
Show FieldPath # 
Instance details

Defined in CabalFmt.Comments

Methods

showsPrec :: Int -> FieldPath -> ShowS

show :: FieldPath -> String

showList :: [FieldPath] -> ShowS

Eq FieldPath # 
Instance details

Defined in CabalFmt.Comments

Methods

(==) :: FieldPath -> FieldPath -> Bool

(/=) :: FieldPath -> FieldPath -> Bool

Ord FieldPath # 
Instance details

Defined in CabalFmt.Comments

Methods

compare :: FieldPath -> FieldPath -> Ordering

(<) :: FieldPath -> FieldPath -> Bool

(<=) :: FieldPath -> FieldPath -> Bool

(>) :: FieldPath -> FieldPath -> Bool

(>=) :: FieldPath -> FieldPath -> Bool

max :: FieldPath -> FieldPath -> FieldPath

min :: FieldPath -> FieldPath -> FieldPath

fieldUniverseN :: [Field ann] -> [(FieldPath, Field ann)] #

fieldUniverse :: Field ann -> [(FieldPath, Field ann)] #

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