-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Haskell source code formatter
--   
--   See <a>the README</a>.
--   
--   If you are interested in the implementation, have a look at <a>this
--   document</a>;
--   
--   The implementation is documented in more detail <a>here</a>.
@package brittany
@version 0.9.0.1

module Language.Haskell.Brittany.Internal.Prelude

module Language.Haskell.Brittany.Internal.PreludeUtils
traceFunctionWith :: String -> (a -> String) -> (b -> String) -> (a -> b) -> (a -> b)
(<&!>) :: Monad m => m a -> (a -> b) -> m b
putStrErrLn :: String -> IO ()
putStrErr :: String -> IO ()
printErr :: Show a => a -> IO ()
errorIf :: Bool -> a -> a
errorIfNote :: Maybe String -> a -> a
(<&>) :: Functor f => f a -> (a -> b) -> f b
infixl 4 <&>
(.>) :: (a -> b) -> (b -> c) -> (a -> c)
infixl 9 .>
evaluateDeep :: NFData a => a -> IO a
instance GHC.Base.Applicative Data.Strict.Maybe.Maybe
instance GHC.Base.Monad Data.Strict.Maybe.Maybe
instance GHC.Base.Alternative Data.Strict.Maybe.Maybe

module Language.Haskell.Brittany.Internal.Config.Types
confUnpack :: Coercible a b => Identity a -> b
data CDebugConfig f
DebugConfig :: f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> CDebugConfig f
[_dconf_dump_config] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_annotations] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_ast_unknown] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_ast_full] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_raw] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_alt] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_floating] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_par] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_columns] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_indent] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_final] :: CDebugConfig f -> f (Last Bool)
[_dconf_roundtrip_exactprint_only] :: CDebugConfig f -> f (Last Bool)
data CLayoutConfig f
LayoutConfig :: f (Last Int) -> f (Last IndentPolicy) -> f (Last Int) -> f (Last Bool) -> f (Last Bool) -> f (Last Int) -> f (Last AltChooser) -> f (Last ColumnAlignMode) -> f (Last Int) -> f (Last Bool) -> f (Last Bool) -> CLayoutConfig f
[_lconfig_cols] :: CLayoutConfig f -> f (Last Int)
[_lconfig_indentPolicy] :: CLayoutConfig f -> f (Last IndentPolicy)
[_lconfig_indentAmount] :: CLayoutConfig f -> f (Last Int)
[_lconfig_indentWhereSpecial] :: CLayoutConfig f -> f (Last Bool)
[_lconfig_indentListSpecial] :: CLayoutConfig f -> f (Last Bool)
[_lconfig_importColumn] :: CLayoutConfig f -> f (Last Int)
[_lconfig_altChooser] :: CLayoutConfig f -> f (Last AltChooser)
[_lconfig_columnAlignMode] :: CLayoutConfig f -> f (Last ColumnAlignMode)
[_lconfig_alignmentLimit] :: CLayoutConfig f -> f (Last Int)
[_lconfig_alignmentBreakOnMultiline] :: CLayoutConfig f -> f (Last Bool)
[_lconfig_hangingTypeSignature] :: CLayoutConfig f -> f (Last Bool)
data CForwardOptions f
ForwardOptions :: f [String] -> CForwardOptions f
[_options_ghc] :: CForwardOptions f -> f [String]
data CErrorHandlingConfig f
ErrorHandlingConfig :: f (Last Bool) -> f (Last Bool) -> f (Last ExactPrintFallbackMode) -> f (Last Bool) -> CErrorHandlingConfig f
[_econf_produceOutputOnErrors] :: CErrorHandlingConfig f -> f (Last Bool)
[_econf_Werror] :: CErrorHandlingConfig f -> f (Last Bool)

-- | Determines when to fall back on the exactprint'ed output when
--   syntactical constructs are encountered which are not yet handled by
--   brittany. Note that the "risky" setting is risky because even with the
--   check of the syntactic validity of the brittany output, at least in
--   theory there may be cases where the output is
--   syntactically/semantically valid but has different semantics than the
--   code pre-transformation.
[_econf_ExactPrintFallback] :: CErrorHandlingConfig f -> f (Last ExactPrintFallbackMode)
[_econf_omit_output_valid_check] :: CErrorHandlingConfig f -> f (Last Bool)
data CPreProcessorConfig f
PreProcessorConfig :: f (Last CPPMode) -> f (Last Bool) -> CPreProcessorConfig f
[_ppconf_CPPMode] :: CPreProcessorConfig f -> f (Last CPPMode)
[_ppconf_hackAroundIncludes] :: CPreProcessorConfig f -> f (Last Bool)
data CConfig f
Config :: f (Last Int) -> CDebugConfig f -> CLayoutConfig f -> CErrorHandlingConfig f -> CForwardOptions f -> CPreProcessorConfig f -> CConfig f
[_conf_version] :: CConfig f -> f (Last Int)
[_conf_debug] :: CConfig f -> CDebugConfig f
[_conf_layout] :: CConfig f -> CLayoutConfig f
[_conf_errorHandling] :: CConfig f -> CErrorHandlingConfig f
[_conf_forward] :: CConfig f -> CForwardOptions f
[_conf_preprocessor] :: CConfig f -> CPreProcessorConfig f
type DebugConfig = CDebugConfig Identity
type LayoutConfig = CLayoutConfig Identity
type ForwardOptions = CForwardOptions Identity
type ErrorHandlingConfig = CErrorHandlingConfig Identity
type Config = CConfig Identity
data IndentPolicy
IndentPolicyLeft :: IndentPolicy
IndentPolicyFree :: IndentPolicy
IndentPolicyMultiple :: IndentPolicy
data AltChooser
AltChooserSimpleQuick :: AltChooser
AltChooserShallowBest :: AltChooser
AltChooserBoundedSearch :: Int -> AltChooser
data ColumnAlignMode

-- | Make no column alignments whatsoever
ColumnAlignModeDisabled :: ColumnAlignMode

-- | Make column alignments only if it does not cause overflow for any of
--   the affected lines.
ColumnAlignModeUnanimously :: ColumnAlignMode

-- | If at least (ratio::Float) of the aligned elements have sufficient
--   space for the alignment, act like ColumnAlignModeAnimously; otherwise
--   act like ColumnAlignModeDisabled.
ColumnAlignModeMajority :: Float -> ColumnAlignMode

-- | Scale back columns to some degree if their sum leads to overflow. This
--   is done in a linear fashion. The Int specifies additional columns to
--   be added to column maximum for scaling calculation purposes.
ColumnAlignModeAnimouslyScale :: Int -> ColumnAlignMode

-- | Decide on a case-by-case basis if alignment would cause overflow. If
--   it does, cancel all alignments for this (nested) column description.
--   ColumnAlignModeAnimouslySome -- potentially to implement
ColumnAlignModeAnimously :: ColumnAlignMode

-- | Always respect column alignments, even if it makes stuff overflow.
ColumnAlignModeAlways :: ColumnAlignMode
data CPPMode
CPPModeAbort :: CPPMode
CPPModeWarn :: CPPMode
CPPModeNowarn :: CPPMode
data ExactPrintFallbackMode
ExactPrintFallbackModeNever :: ExactPrintFallbackMode
ExactPrintFallbackModeInline :: ExactPrintFallbackMode
ExactPrintFallbackModeRisky :: ExactPrintFallbackMode
cMap :: CZipWith k => (forall a. f a -> g a) -> k f -> k g
instance Data.CZipWith.CZipWith Language.Haskell.Brittany.Internal.Config.Types.CConfig
instance Data.CZipWith.CZipWith Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig
instance Data.CZipWith.CZipWith Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions
instance Data.CZipWith.CZipWith Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig
instance Data.CZipWith.CZipWith Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig
instance Data.CZipWith.CZipWith Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig
instance GHC.Generics.Generic (Language.Haskell.Brittany.Internal.Config.Types.CConfig f)
instance GHC.Generics.Generic (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig f)
instance Data.Data.Data Language.Haskell.Brittany.Internal.Config.Types.ExactPrintFallbackMode
instance GHC.Generics.Generic Language.Haskell.Brittany.Internal.Config.Types.ExactPrintFallbackMode
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Config.Types.ExactPrintFallbackMode
instance GHC.Generics.Generic (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig f)
instance Data.Data.Data Language.Haskell.Brittany.Internal.Config.Types.CPPMode
instance GHC.Generics.Generic Language.Haskell.Brittany.Internal.Config.Types.CPPMode
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Config.Types.CPPMode
instance GHC.Generics.Generic (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig f)
instance Data.Data.Data Language.Haskell.Brittany.Internal.Config.Types.ColumnAlignMode
instance GHC.Generics.Generic Language.Haskell.Brittany.Internal.Config.Types.ColumnAlignMode
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Config.Types.ColumnAlignMode
instance Data.Data.Data Language.Haskell.Brittany.Internal.Config.Types.AltChooser
instance GHC.Generics.Generic Language.Haskell.Brittany.Internal.Config.Types.AltChooser
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Config.Types.AltChooser
instance Data.Data.Data Language.Haskell.Brittany.Internal.Config.Types.IndentPolicy
instance GHC.Generics.Generic Language.Haskell.Brittany.Internal.Config.Types.IndentPolicy
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Config.Types.IndentPolicy
instance GHC.Classes.Eq Language.Haskell.Brittany.Internal.Config.Types.IndentPolicy
instance GHC.Generics.Generic (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions f)
instance GHC.Generics.Generic (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig f)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig Data.Functor.Identity.Identity)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig Data.Functor.Identity.Identity)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig Data.Functor.Identity.Identity)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions Data.Functor.Identity.Identity)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig Data.Functor.Identity.Identity)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CConfig Data.Functor.Identity.Identity)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig Data.Semigroup.Option)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig Data.Semigroup.Option)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig Data.Semigroup.Option)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions Data.Semigroup.Option)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig Data.Semigroup.Option)
instance GHC.Show.Show (Language.Haskell.Brittany.Internal.Config.Types.CConfig Data.Semigroup.Option)
instance Data.Data.Data (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig Data.Functor.Identity.Identity)
instance Data.Data.Data (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig Data.Functor.Identity.Identity)
instance Data.Data.Data (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig Data.Functor.Identity.Identity)
instance Data.Data.Data (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions Data.Functor.Identity.Identity)
instance Data.Data.Data (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig Data.Functor.Identity.Identity)
instance Data.Data.Data (Language.Haskell.Brittany.Internal.Config.Types.CConfig Data.Functor.Identity.Identity)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CConfig Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CConfig Data.Functor.Identity.Identity)
instance GHC.Base.Monoid (Language.Haskell.Brittany.Internal.Config.Types.CConfig Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig Data.Functor.Identity.Identity)
instance GHC.Base.Monoid (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig Data.Functor.Identity.Identity)
instance GHC.Base.Monoid (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig Data.Functor.Identity.Identity)
instance GHC.Base.Monoid (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions Data.Functor.Identity.Identity)
instance GHC.Base.Monoid (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig Data.Semigroup.Option)
instance Data.Semigroup.Semigroup (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig Data.Functor.Identity.Identity)
instance GHC.Base.Monoid (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig Data.Semigroup.Option)

module Language.Haskell.Brittany.Internal.Config.Types.Instances
aesonDecodeOptionsBrittany :: Options
(.:?=) :: FromJSON a => Object -> Text -> Parser a
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig Data.Semigroup.Option)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig GHC.Base.Maybe)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig Data.Semigroup.Option)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CDebugConfig GHC.Base.Maybe)
instance Data.Aeson.Types.FromJSON.FromJSON Language.Haskell.Brittany.Internal.Config.Types.IndentPolicy
instance Data.Aeson.Types.ToJSON.ToJSON Language.Haskell.Brittany.Internal.Config.Types.IndentPolicy
instance Data.Aeson.Types.FromJSON.FromJSON Language.Haskell.Brittany.Internal.Config.Types.AltChooser
instance Data.Aeson.Types.ToJSON.ToJSON Language.Haskell.Brittany.Internal.Config.Types.AltChooser
instance Data.Aeson.Types.FromJSON.FromJSON Language.Haskell.Brittany.Internal.Config.Types.ColumnAlignMode
instance Data.Aeson.Types.ToJSON.ToJSON Language.Haskell.Brittany.Internal.Config.Types.ColumnAlignMode
instance Data.Aeson.Types.FromJSON.FromJSON Language.Haskell.Brittany.Internal.Config.Types.CPPMode
instance Data.Aeson.Types.ToJSON.ToJSON Language.Haskell.Brittany.Internal.Config.Types.CPPMode
instance Data.Aeson.Types.FromJSON.FromJSON Language.Haskell.Brittany.Internal.Config.Types.ExactPrintFallbackMode
instance Data.Aeson.Types.ToJSON.ToJSON Language.Haskell.Brittany.Internal.Config.Types.ExactPrintFallbackMode
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig Data.Semigroup.Option)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig GHC.Base.Maybe)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig Data.Semigroup.Option)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CLayoutConfig GHC.Base.Maybe)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig Data.Semigroup.Option)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig GHC.Base.Maybe)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig Data.Semigroup.Option)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CErrorHandlingConfig GHC.Base.Maybe)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions Data.Semigroup.Option)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions GHC.Base.Maybe)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions Data.Semigroup.Option)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CForwardOptions GHC.Base.Maybe)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig Data.Semigroup.Option)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig GHC.Base.Maybe)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig Data.Semigroup.Option)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CPreProcessorConfig GHC.Base.Maybe)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CConfig Data.Semigroup.Option)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CConfig Data.Semigroup.Option)
instance Data.Aeson.Types.ToJSON.ToJSON (Language.Haskell.Brittany.Internal.Config.Types.CConfig GHC.Base.Maybe)
instance Data.Aeson.Types.FromJSON.FromJSON (Language.Haskell.Brittany.Internal.Config.Types.CConfig GHC.Base.Maybe)

module Language.Haskell.Brittany.Internal.Types
type PPM = MultiRWS '[Map AnnKey Anns, Config, Anns] '[Builder, [BrittanyError], Seq String] '[]
type PPMLocal = MultiRWS '[Config, Anns] '[Builder, [BrittanyError], Seq String] '[]
data LayoutState
LayoutState :: [Int] -> Either Int Int -> [Int] -> Int -> Anns -> Maybe Int -> Maybe Int -> LayoutState

-- | stack of number of current indentation columns (not number of
--   indentations).
[_lstate_baseYs] :: LayoutState -> [Int]

-- | Either: 1) number of chars in the current line. 2) number of newlines
--   to be inserted before inserting any non-space elements.
[_lstate_curYOrAddNewline] :: LayoutState -> Either Int Int

-- | stack of current indentation levels. set for any layout-affected
--   elements such as let<i>do</i>case/where elements. The main purpose of
--   this member is to properly align comments, as their annotation
--   positions are relative to the current layout indentation level.
[_lstate_indLevels] :: LayoutState -> [Int]
[_lstate_indLevelLinger] :: LayoutState -> Int
[_lstate_comments] :: LayoutState -> Anns
[_lstate_commentCol] :: LayoutState -> Maybe Int
[_lstate_addSepSpace] :: LayoutState -> Maybe Int
lstate_baseY :: LayoutState -> Int
lstate_indLevel :: LayoutState -> Int
data BrittanyError

-- | parsing failed
ErrorInput :: String -> BrittanyError

-- | internal error: some comment went missing
ErrorUnusedComment :: String -> BrittanyError

-- | some warning
LayoutWarning :: String -> BrittanyError

-- | internal error: pretty-printing is not implemented for type of node in
--   the syntax-tree
ErrorUnknownNode :: String -> ast -> BrittanyError

-- | checking the output for syntactic validity failed
ErrorOutputCheck :: BrittanyError
data BriSpacing
BriSpacing :: Int -> Int -> BriSpacing
[_bs_spacePastLineIndent] :: BriSpacing -> Int
[_bs_spacePastIndent] :: BriSpacing -> Int
data ColSig
ColTyOpPrefix :: ColSig
ColPatternsFuncPrefix :: ColSig
ColPatternsFuncInfix :: ColSig
ColPatterns :: ColSig
ColCasePattern :: ColSig
ColBindingLine :: (Maybe Text) -> ColSig
ColGuard :: ColSig
ColGuardedBody :: ColSig
ColBindStmt :: ColSig
ColDoLet :: ColSig
ColRecUpdate :: ColSig
ColListComp :: ColSig
ColList :: ColSig
ColApp :: ColSig
ColTuple :: ColSig
ColTuples :: ColSig
ColOpPrefix :: ColSig
data BrIndent
BrIndentNone :: BrIndent
BrIndentRegular :: BrIndent
BrIndentSpecial :: Int -> BrIndent
type ToBriDocM = MultiRWS '[Config, Anns] '[[BrittanyError], Seq String] '[NodeAllocIndex]
type ToBriDoc (sym :: * -> *) = Located (sym RdrName) -> ToBriDocM BriDocNumbered
type ToBriDoc' sym = Located sym -> ToBriDocM BriDocNumbered
type ToBriDocC sym c = Located sym -> ToBriDocM c
data DocMultiLine
MultiLineNo :: DocMultiLine
MultiLinePossible :: DocMultiLine
data BriDoc
BDEmpty :: BriDoc
BDLit :: !Text -> BriDoc
BDSeq :: [BriDoc] -> BriDoc
BDCols :: ColSig -> [BriDoc] -> BriDoc
BDSeparator :: BriDoc
BDAddBaseY :: BrIndent -> BriDoc -> BriDoc
BDBaseYPushCur :: BriDoc -> BriDoc
BDBaseYPop :: BriDoc -> BriDoc
BDIndentLevelPushCur :: BriDoc -> BriDoc
BDIndentLevelPop :: BriDoc -> BriDoc
BDPar :: BrIndent -> BriDoc -> BriDoc -> BriDoc
[_bdpar_indent] :: BriDoc -> BrIndent
[_bdpar_restOfLine] :: BriDoc -> BriDoc
[_bdpar_indented] :: BriDoc -> BriDoc

-- | BDAddIndent BrIndent (BriDocF f) | BDNewline
BDAlt :: [BriDoc] -> BriDoc
BDForwardLineMode :: BriDoc -> BriDoc
BDExternal :: AnnKey -> (Set AnnKey) -> Bool -> Text -> BriDoc
BDAnnotationPrior :: AnnKey -> BriDoc -> BriDoc
BDAnnotationKW :: AnnKey -> (Maybe AnnKeywordId) -> BriDoc -> BriDoc
BDAnnotationRest :: AnnKey -> BriDoc -> BriDoc
BDLines :: [BriDoc] -> BriDoc
BDEnsureIndent :: BrIndent -> BriDoc -> BriDoc
BDForceMultiline :: BriDoc -> BriDoc
BDForceSingleline :: BriDoc -> BriDoc
BDNonBottomSpacing :: BriDoc -> BriDoc
BDSetParSpacing :: BriDoc -> BriDoc
BDForceParSpacing :: BriDoc -> BriDoc
BDDebug :: String -> BriDoc -> BriDoc
data BriDocF f
BDFEmpty :: BriDocF f
BDFLit :: !Text -> BriDocF f
BDFSeq :: [f (BriDocF f)] -> BriDocF f
BDFCols :: ColSig -> [f (BriDocF f)] -> BriDocF f
BDFSeparator :: BriDocF f
BDFAddBaseY :: BrIndent -> (f (BriDocF f)) -> BriDocF f
BDFBaseYPushCur :: (f (BriDocF f)) -> BriDocF f
BDFBaseYPop :: (f (BriDocF f)) -> BriDocF f
BDFIndentLevelPushCur :: (f (BriDocF f)) -> BriDocF f
BDFIndentLevelPop :: (f (BriDocF f)) -> BriDocF f
BDFPar :: BrIndent -> f (BriDocF f) -> f (BriDocF f) -> BriDocF f
[_bdfpar_indent] :: BriDocF f -> BrIndent
[_bdfpar_restOfLine] :: BriDocF f -> f (BriDocF f)
[_bdfpar_indented] :: BriDocF f -> f (BriDocF f)

-- | BDAddIndent BrIndent (BriDocF f) | BDNewline
BDFAlt :: [f (BriDocF f)] -> BriDocF f
BDFForwardLineMode :: (f (BriDocF f)) -> BriDocF f
BDFExternal :: AnnKey -> (Set AnnKey) -> Bool -> Text -> BriDocF f
BDFAnnotationPrior :: AnnKey -> (f (BriDocF f)) -> BriDocF f
BDFAnnotationKW :: AnnKey -> (Maybe AnnKeywordId) -> (f (BriDocF f)) -> BriDocF f
BDFAnnotationRest :: AnnKey -> (f (BriDocF f)) -> BriDocF f
BDFLines :: [(f (BriDocF f))] -> BriDocF f
BDFEnsureIndent :: BrIndent -> (f (BriDocF f)) -> BriDocF f
BDFForceMultiline :: (f (BriDocF f)) -> BriDocF f
BDFForceSingleline :: (f (BriDocF f)) -> BriDocF f
BDFNonBottomSpacing :: (f (BriDocF f)) -> BriDocF f
BDFSetParSpacing :: (f (BriDocF f)) -> BriDocF f
BDFForceParSpacing :: (f (BriDocF f)) -> BriDocF f
BDFDebug :: String -> (f (BriDocF f)) -> BriDocF f
type BriDocFInt = BriDocF ((,) Int)
type BriDocNumbered = (Int, BriDocFInt)
newtype NodeAllocIndex
NodeAllocIndex :: Int -> NodeAllocIndex
unwrapBriDocNumbered :: BriDocNumbered -> BriDoc
isNotEmpty :: BriDoc -> Bool
briDocSeqSpine :: BriDoc -> ()
briDocForceSpine :: BriDoc -> BriDoc
data VerticalSpacingPar
VerticalSpacingParNone :: VerticalSpacingPar
VerticalSpacingParSome :: Int -> VerticalSpacingPar
VerticalSpacingParAlways :: Int -> VerticalSpacingPar
data VerticalSpacing
VerticalSpacing :: !Int -> !VerticalSpacingPar -> !Bool -> VerticalSpacing
[_vs_sameLine] :: VerticalSpacing -> !Int
[_vs_paragraph] :: VerticalSpacing -> !VerticalSpacingPar
[_vs_parFlag] :: VerticalSpacing -> !Bool
newtype LineModeValidity a
LineModeValidity :: (Maybe a) -> LineModeValidity a
instance GHC.Base.Alternative Language.Haskell.Brittany.Internal.Types.LineModeValidity
instance GHC.Show.Show a => GHC.Show.Show (Language.Haskell.Brittany.Internal.Types.LineModeValidity a)
instance GHC.Base.Monad Language.Haskell.Brittany.Internal.Types.LineModeValidity
instance GHC.Base.Applicative Language.Haskell.Brittany.Internal.Types.LineModeValidity
instance GHC.Base.Functor Language.Haskell.Brittany.Internal.Types.LineModeValidity
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Types.VerticalSpacing
instance GHC.Classes.Eq Language.Haskell.Brittany.Internal.Types.VerticalSpacing
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Types.VerticalSpacingPar
instance GHC.Classes.Eq Language.Haskell.Brittany.Internal.Types.VerticalSpacingPar
instance GHC.Classes.Ord Language.Haskell.Brittany.Internal.Types.BriDoc
instance GHC.Classes.Eq Language.Haskell.Brittany.Internal.Types.BriDoc
instance Data.Data.Data Language.Haskell.Brittany.Internal.Types.BriDoc
instance GHC.Classes.Eq Language.Haskell.Brittany.Internal.Types.DocMultiLine
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Types.BrIndent
instance Data.Data.Data Language.Haskell.Brittany.Internal.Types.BrIndent
instance GHC.Classes.Ord Language.Haskell.Brittany.Internal.Types.BrIndent
instance GHC.Classes.Eq Language.Haskell.Brittany.Internal.Types.BrIndent
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Types.ColSig
instance Data.Data.Data Language.Haskell.Brittany.Internal.Types.ColSig
instance GHC.Classes.Ord Language.Haskell.Brittany.Internal.Types.ColSig
instance GHC.Classes.Eq Language.Haskell.Brittany.Internal.Types.ColSig
instance Data.Data.Data (Language.Haskell.Brittany.Internal.Types.BriDocF ((,) GHC.Types.Int))
instance Data.Generics.Uniplate.Operations.Uniplate Language.Haskell.Brittany.Internal.Types.BriDoc
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Types.LayoutState

module Language.Haskell.Brittany.Internal.Utils
parDoc :: String -> Doc
parDocW :: [String] -> Doc
fromMaybeIdentity :: Identity a -> Maybe a -> Identity a
fromOptionIdentity :: Identity a -> Option a -> Identity a
traceIfDumpConf :: (MonadMultiReader Config m, Show a) => String -> (DebugConfig -> Identity (Last Bool)) -> a -> m ()
mModify :: MonadMultiState s m => (s -> s) -> m ()
customLayouterF :: Anns -> LayouterF
astToDoc :: Data ast => ast -> Doc
briDocToDoc :: BriDoc -> Doc
annsDoc :: Anns -> Doc
newtype Max a
Max :: a -> Max a
[getMax] :: Max a -> a
tellDebugMess :: MonadMultiWriter (Seq String) m => String -> m ()
tellDebugMessShow :: forall a m. (MonadMultiWriter (Seq String) m, Show a) => a -> m ()
briDocToDocWithAnns :: BriDoc -> Doc
breakEither :: (a -> Either b c) -> [a] -> ([b], [c])
spanMaybe :: (a -> Maybe b) -> [a] -> ([b], [a])
transformUp :: Uniplate on => (on -> on) -> (on -> on)
transformDownMay :: Uniplate on => (on -> Maybe on) -> (on -> on)
data FirstLastView a
FirstLastEmpty :: FirstLastView a
FirstLastSingleton :: a -> FirstLastView a
FirstLast :: a -> [a] -> a -> FirstLastView a
splitFirstLast :: [a] -> FirstLastView a

-- | similar to List.lines, but treating the case of final newline
--   character in such a manner that this function is the inverse of
--   <tt>intercalate "n"</tt>.
lines' :: String -> [String]
instance Data.Data.Data x => Data.Data.Data (Language.Haskell.Brittany.Internal.Utils.A x)
instance Data.Data.Data Language.Haskell.Brittany.Internal.Utils.ShowIsId
instance GHC.Num.Num a => GHC.Num.Num (Language.Haskell.Brittany.Internal.Utils.Max a)
instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Language.Haskell.Brittany.Internal.Utils.Max a)
instance GHC.Show.Show a => GHC.Show.Show (Language.Haskell.Brittany.Internal.Utils.Max a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Language.Haskell.Brittany.Internal.Utils.Max a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Haskell.Brittany.Internal.Utils.Max a)
instance GHC.Show.Show Language.Haskell.Brittany.Internal.Utils.ShowIsId
instance (GHC.Num.Num a, GHC.Classes.Ord a) => GHC.Base.Monoid (Language.Haskell.Brittany.Internal.Utils.Max a)

module Language.Haskell.Brittany.Internal.Config
data CConfig f
Config :: f (Last Int) -> CDebugConfig f -> CLayoutConfig f -> CErrorHandlingConfig f -> CForwardOptions f -> CPreProcessorConfig f -> CConfig f
[_conf_version] :: CConfig f -> f (Last Int)
[_conf_debug] :: CConfig f -> CDebugConfig f
[_conf_layout] :: CConfig f -> CLayoutConfig f
[_conf_errorHandling] :: CConfig f -> CErrorHandlingConfig f
[_conf_forward] :: CConfig f -> CForwardOptions f
[_conf_preprocessor] :: CConfig f -> CPreProcessorConfig f
data CDebugConfig f
DebugConfig :: f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> CDebugConfig f
[_dconf_dump_config] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_annotations] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_ast_unknown] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_ast_full] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_raw] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_alt] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_floating] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_par] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_columns] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_indent] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_final] :: CDebugConfig f -> f (Last Bool)
[_dconf_roundtrip_exactprint_only] :: CDebugConfig f -> f (Last Bool)
data CLayoutConfig f
LayoutConfig :: f (Last Int) -> f (Last IndentPolicy) -> f (Last Int) -> f (Last Bool) -> f (Last Bool) -> f (Last Int) -> f (Last AltChooser) -> f (Last ColumnAlignMode) -> f (Last Int) -> f (Last Bool) -> f (Last Bool) -> CLayoutConfig f
[_lconfig_cols] :: CLayoutConfig f -> f (Last Int)
[_lconfig_indentPolicy] :: CLayoutConfig f -> f (Last IndentPolicy)
[_lconfig_indentAmount] :: CLayoutConfig f -> f (Last Int)
[_lconfig_indentWhereSpecial] :: CLayoutConfig f -> f (Last Bool)
[_lconfig_indentListSpecial] :: CLayoutConfig f -> f (Last Bool)
[_lconfig_importColumn] :: CLayoutConfig f -> f (Last Int)
[_lconfig_altChooser] :: CLayoutConfig f -> f (Last AltChooser)
[_lconfig_columnAlignMode] :: CLayoutConfig f -> f (Last ColumnAlignMode)
[_lconfig_alignmentLimit] :: CLayoutConfig f -> f (Last Int)
[_lconfig_alignmentBreakOnMultiline] :: CLayoutConfig f -> f (Last Bool)
[_lconfig_hangingTypeSignature] :: CLayoutConfig f -> f (Last Bool)
type DebugConfig = CDebugConfig Identity
type LayoutConfig = CLayoutConfig Identity
type Config = CConfig Identity
configParser :: CmdParser Identity out (CConfig Option)
staticDefaultConfig :: Config
forwardOptionsSyntaxExtsEnabled :: ForwardOptions

-- | Reads a config from a file. If the file does not exist, returns
--   Nothing. If the file exists and parsing fails, prints to stderr and
--   aborts the MaybeT. Otherwise succeed via Just. If the second parameter
--   is True and the file does not exist, writes the staticDefaultConfig to
--   the file.
readConfig :: MonadIO m => FilePath -> MaybeT m (Maybe (CConfig Option))
writeDefaultConfig :: MonadIO m => FilePath -> m ()
showConfigYaml :: Config -> String

module Language.Haskell.Brittany.Internal

-- | Exposes the transformation in an pseudo-pure fashion. The signature
--   contains <a>IO</a> 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 <a>trace</a>/write to stderr.
--   
--   Note that the ghc parsing function used internally currently is
--   wrapped in <tt>mask_</tt>, 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.
parsePrintModule :: Config -> Text -> IO (Either [BrittanyError] Text)
parsePrintModuleTests :: Config -> String -> Text -> IO (Either String Text)
pPrintModule :: Config -> Anns -> ParsedSource -> ([BrittanyError], Text)

-- | Additionally checks that the output compiles again, appending an error
--   if it does not.
pPrintModuleAndCheck :: Config -> Anns -> ParsedSource -> IO ([BrittanyError], Text)
parseModule :: [String] -> FilePath -> (DynFlags -> IO (Either String a)) -> IO (Either String (Anns, ParsedSource, a))
parseModuleFromString :: [String] -> FilePath -> (DynFlags -> IO (Either String a)) -> String -> IO (Either String (Anns, ParsedSource, a))

module Language.Haskell.Brittany

-- | Exposes the transformation in an pseudo-pure fashion. The signature
--   contains <a>IO</a> 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 <a>trace</a>/write to stderr.
--   
--   Note that the ghc parsing function used internally currently is
--   wrapped in <tt>mask_</tt>, 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.
parsePrintModule :: Config -> Text -> IO (Either [BrittanyError] Text)
staticDefaultConfig :: Config
forwardOptionsSyntaxExtsEnabled :: ForwardOptions
type Config = CConfig Identity
data CConfig f
Config :: f (Last Int) -> CDebugConfig f -> CLayoutConfig f -> CErrorHandlingConfig f -> CForwardOptions f -> CPreProcessorConfig f -> CConfig f
[_conf_version] :: CConfig f -> f (Last Int)
[_conf_debug] :: CConfig f -> CDebugConfig f
[_conf_layout] :: CConfig f -> CLayoutConfig f
[_conf_errorHandling] :: CConfig f -> CErrorHandlingConfig f
[_conf_forward] :: CConfig f -> CForwardOptions f
[_conf_preprocessor] :: CConfig f -> CPreProcessorConfig f
data CDebugConfig f
DebugConfig :: f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> f (Last Bool) -> CDebugConfig f
[_dconf_dump_config] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_annotations] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_ast_unknown] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_ast_full] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_raw] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_alt] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_floating] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_par] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_columns] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_simpl_indent] :: CDebugConfig f -> f (Last Bool)
[_dconf_dump_bridoc_final] :: CDebugConfig f -> f (Last Bool)
[_dconf_roundtrip_exactprint_only] :: CDebugConfig f -> f (Last Bool)
data CLayoutConfig f
LayoutConfig :: f (Last Int) -> f (Last IndentPolicy) -> f (Last Int) -> f (Last Bool) -> f (Last Bool) -> f (Last Int) -> f (Last AltChooser) -> f (Last ColumnAlignMode) -> f (Last Int) -> f (Last Bool) -> f (Last Bool) -> CLayoutConfig f
[_lconfig_cols] :: CLayoutConfig f -> f (Last Int)
[_lconfig_indentPolicy] :: CLayoutConfig f -> f (Last IndentPolicy)
[_lconfig_indentAmount] :: CLayoutConfig f -> f (Last Int)
[_lconfig_indentWhereSpecial] :: CLayoutConfig f -> f (Last Bool)
[_lconfig_indentListSpecial] :: CLayoutConfig f -> f (Last Bool)
[_lconfig_importColumn] :: CLayoutConfig f -> f (Last Int)
[_lconfig_altChooser] :: CLayoutConfig f -> f (Last AltChooser)
[_lconfig_columnAlignMode] :: CLayoutConfig f -> f (Last ColumnAlignMode)
[_lconfig_alignmentLimit] :: CLayoutConfig f -> f (Last Int)
[_lconfig_alignmentBreakOnMultiline] :: CLayoutConfig f -> f (Last Bool)
[_lconfig_hangingTypeSignature] :: CLayoutConfig f -> f (Last Bool)
data CErrorHandlingConfig f
ErrorHandlingConfig :: f (Last Bool) -> f (Last Bool) -> f (Last ExactPrintFallbackMode) -> f (Last Bool) -> CErrorHandlingConfig f
[_econf_produceOutputOnErrors] :: CErrorHandlingConfig f -> f (Last Bool)
[_econf_Werror] :: CErrorHandlingConfig f -> f (Last Bool)

-- | Determines when to fall back on the exactprint'ed output when
--   syntactical constructs are encountered which are not yet handled by
--   brittany. Note that the "risky" setting is risky because even with the
--   check of the syntactic validity of the brittany output, at least in
--   theory there may be cases where the output is
--   syntactically/semantically valid but has different semantics than the
--   code pre-transformation.
[_econf_ExactPrintFallback] :: CErrorHandlingConfig f -> f (Last ExactPrintFallbackMode)
[_econf_omit_output_valid_check] :: CErrorHandlingConfig f -> f (Last Bool)
data CForwardOptions f
ForwardOptions :: f [String] -> CForwardOptions f
[_options_ghc] :: CForwardOptions f -> f [String]
data CPreProcessorConfig f
PreProcessorConfig :: f (Last CPPMode) -> f (Last Bool) -> CPreProcessorConfig f
[_ppconf_CPPMode] :: CPreProcessorConfig f -> f (Last CPPMode)
[_ppconf_hackAroundIncludes] :: CPreProcessorConfig f -> f (Last Bool)
data BrittanyError

-- | parsing failed
ErrorInput :: String -> BrittanyError

-- | internal error: some comment went missing
ErrorUnusedComment :: String -> BrittanyError

-- | some warning
LayoutWarning :: String -> BrittanyError

-- | internal error: pretty-printing is not implemented for type of node in
--   the syntax-tree
ErrorUnknownNode :: String -> ast -> BrittanyError

-- | checking the output for syntactic validity failed
ErrorOutputCheck :: BrittanyError

module Paths_brittany
version :: Version
getBinDir :: IO FilePath
getLibDir :: IO FilePath
getDynLibDir :: IO FilePath
getDataDir :: IO FilePath
getLibexecDir :: IO FilePath
getDataFileName :: FilePath -> IO FilePath
getSysconfDir :: IO FilePath
