Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Haskell indenter.
Synopsis
- hindent :: [String] -> IO ()
- reformat :: Config -> [Extension] -> Maybe FilePath -> ByteString -> Either ParseError ByteString
- data Config = Config {}
- defaultConfig :: Config
- getConfig :: IO Config
- data Extension
- data ParseError = ParseError {}
- prettyParseError :: ParseError -> String
- testAst :: ByteString -> Either ParseError HsModule'
- type HsModule' = HsModule GhcPs
The entry point.
Formatting functions.
reformat :: Config -> [Extension] -> Maybe FilePath -> ByteString -> Either ParseError ByteString Source #
Format the given source.
Config
Configurations shared among the different styles. Styles may pay attention to or completely disregard this configuration.
Config | |
|
defaultConfig :: Config Source #
Default style configuration.
Extension
Language Extension. Either enabled or disabled.
The Cabal
package also has an Extension
type that can be used to
indicate whether an extension is enabled or disabled, but Cabal's one
should be avoided as much as possible. The KnownExtension
of Cabal
may not have the latest extensions, and if such extensions are used,
there will be cases where GHC can build, but HIndent cannot format.
Error
data ParseError Source #
Parse error type with the location.
Instances
Read ParseError Source # | |
Defined in HIndent.Error readsPrec :: Int -> ReadS ParseError # readList :: ReadS [ParseError] # readPrec :: ReadPrec ParseError # readListPrec :: ReadPrec [ParseError] # | |
Show ParseError Source # | |
Defined in HIndent.Error showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # | |
Eq ParseError Source # | |
Defined in HIndent.Error (==) :: ParseError -> ParseError -> Bool # (/=) :: ParseError -> ParseError -> Bool # | |
Ord ParseError Source # | |
Defined in HIndent.Error compare :: ParseError -> ParseError -> Ordering # (<) :: ParseError -> ParseError -> Bool # (<=) :: ParseError -> ParseError -> Bool # (>) :: ParseError -> ParseError -> Bool # (>=) :: ParseError -> ParseError -> Bool # max :: ParseError -> ParseError -> ParseError # min :: ParseError -> ParseError -> ParseError # |
prettyParseError :: ParseError -> String Source #
Pretty-print ParseError
.
Testing
testAst :: ByteString -> Either ParseError HsModule' Source #
Generate an AST from the given module for debugging.