brittany-0.9.0.1: Haskell source code formatter

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Brittany.Internal

Synopsis

Documentation

parsePrintModule :: Config -> Text -> IO (Either [BrittanyError] Text) Source #

Exposes the transformation in an pseudo-pure fashion. The signature contains IO due to the GHC API not exposing a pure parsing function, but there should be no observable effects.

Note that this function ignores/resets all config values regarding debugging, i.e. it will never use trace/write to stderr.

Note that the ghc parsing function used internally currently is wrapped in mask_, so cannot be killed easily. If you don't control the input, you may wish to put some proper upper bound on the input's size as a timeout won't do.

pPrintModuleAndCheck :: Config -> Anns -> ParsedSource -> IO ([BrittanyError], Text) Source #

Additionally checks that the output compiles again, appending an error if it does not.