Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Parser = Parsec Void String
- targetName :: Parser CompilableName
- restOfLine :: Parser String
- emptyLine :: Parser String
- indentedLine :: Int -> Parser String
- indentedLines :: Int -> Parser [String]
- nestedSection :: Parser NestedSection
- nestedSections :: Parser [NestedSection]
- section :: Parser Section
- sections :: Parser [Section]
- parseCabalSections :: String -> Either String [Section]
- renderCabalSections :: [Section] -> String
- readCabalSections :: FilePath -> IO (Either String [Section])
- writeCabalSections :: FilePath -> [Section] -> IO ()
Documentation
indentedLine :: Int -> Parser String Source #
Parse an indented line with indentedLine numSpaces
, failing if the line isn't indented to numSpaces
.
indentedLines :: Int -> Parser [String] Source #
Parse many indented lines with indentedLines numSpaces
, traversing empty lines until the line isn't indented to numSpaces
.
renderCabalSections :: [Section] -> String Source #
Render sections. parseCabalSections . renderCabalSections
should be equivalent to Right
.
readCabalSections :: FilePath -> IO (Either String [Section]) Source #
Read sections from a file using parseCabalSections
.
writeCabalSections :: FilePath -> [Section] -> IO () Source #
Write sections to a file using renderCabalSections
.