-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A flexible Haskell source code pretty printer -- -- A flexible Haskell source code pretty printer. -- -- See the Github page for usage/explanation: -- https://github.com/ennocramer/floskell @package floskell @version 0.10.0 module Floskell.Attoparsec data Position parseOnly :: Parser a -> ByteString -> Either String a instance GHC.Show.Show Floskell.Attoparsec.Position instance GHC.Classes.Ord Floskell.Attoparsec.Position instance GHC.Classes.Eq Floskell.Attoparsec.Position instance GHC.Base.Semigroup Floskell.Attoparsec.Position instance GHC.Base.Monoid Floskell.Attoparsec.Position -- | An outout buffer for ByteStrings that keeps track of line and column -- numbers. module Floskell.Buffer data Buffer -- | An empty output buffer. empty :: Buffer -- | Append a newline to the output buffer. newline :: Buffer -> Buffer -- | Append a ByteString to the output buffer. It is an error for the -- string to contain newlines. write :: ByteString -> Buffer -> Buffer -- | Return the current line number, counting from 0. line :: Buffer -> Int -- | Return the column number, counting from 0. column :: Buffer -> Int -- | Return the contents of the output buffer as a lazy ByteString. toLazyByteString :: Buffer -> ByteString module Floskell.Config data Indent Align :: Indent IndentBy :: !Int -> Indent AlignOrIndentBy :: !Int -> Indent data LayoutContext Declaration :: LayoutContext Type :: LayoutContext Pattern :: LayoutContext Expression :: LayoutContext Other :: LayoutContext data Location Before :: Location After :: Location data WsLoc WsNone :: WsLoc WsBefore :: WsLoc WsAfter :: WsLoc WsBoth :: WsLoc data Whitespace Whitespace :: !WsLoc -> !WsLoc -> !Bool -> Whitespace [wsSpaces] :: Whitespace -> !WsLoc [wsLinebreaks] :: Whitespace -> !WsLoc [wsForceLinebreak] :: Whitespace -> !Bool data Layout Flex :: Layout Vertical :: Layout TryOneline :: Layout data ConfigMapKey ConfigMapKey :: !Maybe ByteString -> !Maybe LayoutContext -> ConfigMapKey data ConfigMap a ConfigMap :: !a -> !Map ConfigMapKey a -> ConfigMap a [cfgMapDefault] :: ConfigMap a -> !a [cfgMapOverrides] :: ConfigMap a -> !Map ConfigMapKey a data PenaltyConfig PenaltyConfig :: !Int -> !Int -> !Int -> !Int -> !Int -> PenaltyConfig [penaltyMaxLineLength] :: PenaltyConfig -> !Int [penaltyLinebreak] :: PenaltyConfig -> !Int [penaltyIndent] :: PenaltyConfig -> !Int [penaltyOverfull] :: PenaltyConfig -> !Int [penaltyOverfullOnce] :: PenaltyConfig -> !Int data AlignConfig AlignConfig :: !(Int, Int) -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> !Bool -> AlignConfig [cfgAlignLimits] :: AlignConfig -> !(Int, Int) [cfgAlignCase] :: AlignConfig -> !Bool [cfgAlignClass] :: AlignConfig -> !Bool [cfgAlignImportModule] :: AlignConfig -> !Bool [cfgAlignImportSpec] :: AlignConfig -> !Bool [cfgAlignLetBinds] :: AlignConfig -> !Bool [cfgAlignMatches] :: AlignConfig -> !Bool [cfgAlignRecordFields] :: AlignConfig -> !Bool [cfgAlignWhere] :: AlignConfig -> !Bool data IndentConfig IndentConfig :: !Int -> !Int -> !Int -> !Indent -> !Indent -> !Indent -> !Indent -> !Indent -> !Indent -> !Indent -> !Indent -> !Indent -> !Indent -> !Indent -> !Indent -> !Indent -> IndentConfig [cfgIndentOnside] :: IndentConfig -> !Int [cfgIndentDeriving] :: IndentConfig -> !Int [cfgIndentWhere] :: IndentConfig -> !Int [cfgIndentApp] :: IndentConfig -> !Indent [cfgIndentCase] :: IndentConfig -> !Indent [cfgIndentClass] :: IndentConfig -> !Indent [cfgIndentDo] :: IndentConfig -> !Indent [cfgIndentExportSpecList] :: IndentConfig -> !Indent [cfgIndentIf] :: IndentConfig -> !Indent [cfgIndentImportSpecList] :: IndentConfig -> !Indent [cfgIndentLet] :: IndentConfig -> !Indent [cfgIndentLetBinds] :: IndentConfig -> !Indent [cfgIndentLetIn] :: IndentConfig -> !Indent [cfgIndentMultiIf] :: IndentConfig -> !Indent [cfgIndentTypesig] :: IndentConfig -> !Indent [cfgIndentWhereBinds] :: IndentConfig -> !Indent data LayoutConfig LayoutConfig :: !Layout -> !Layout -> !Layout -> !Layout -> !Layout -> !Layout -> !Layout -> !Layout -> !Layout -> !Layout -> !Layout -> LayoutConfig [cfgLayoutApp] :: LayoutConfig -> !Layout [cfgLayoutConDecls] :: LayoutConfig -> !Layout [cfgLayoutDeclaration] :: LayoutConfig -> !Layout [cfgLayoutExportSpecList] :: LayoutConfig -> !Layout [cfgLayoutIf] :: LayoutConfig -> !Layout [cfgLayoutImportSpecList] :: LayoutConfig -> !Layout [cfgLayoutInfixApp] :: LayoutConfig -> !Layout [cfgLayoutLet] :: LayoutConfig -> !Layout [cfgLayoutListComp] :: LayoutConfig -> !Layout [cfgLayoutRecord] :: LayoutConfig -> !Layout [cfgLayoutType] :: LayoutConfig -> !Layout newtype OpConfig OpConfig :: ConfigMap Whitespace -> OpConfig [unOpConfig] :: OpConfig -> ConfigMap Whitespace newtype GroupConfig GroupConfig :: ConfigMap Whitespace -> GroupConfig [unGroupConfig] :: GroupConfig -> ConfigMap Whitespace data ImportsGroupOrder ImportsGroupKeep :: ImportsGroupOrder ImportsGroupSorted :: ImportsGroupOrder ImportsGroupGrouped :: ImportsGroupOrder data ImportsGroup ImportsGroup :: ![String] -> !ImportsGroupOrder -> ImportsGroup [importsPrefixes] :: ImportsGroup -> ![String] [importsOrder] :: ImportsGroup -> !ImportsGroupOrder data SortImportsRule NoImportSort :: SortImportsRule SortImportsByPrefix :: SortImportsRule SortImportsByGroups :: ![ImportsGroup] -> SortImportsRule data DeclarationConstruct DeclModule :: DeclarationConstruct DeclClass :: DeclarationConstruct DeclInstance :: DeclarationConstruct DeclWhere :: DeclarationConstruct data OptionConfig OptionConfig :: !Bool -> !Bool -> !SortImportsRule -> !Bool -> !Bool -> !Bool -> !Bool -> !Set DeclarationConstruct -> OptionConfig [cfgOptionSortPragmas] :: OptionConfig -> !Bool [cfgOptionSplitLanguagePragmas] :: OptionConfig -> !Bool [cfgOptionSortImports] :: OptionConfig -> !SortImportsRule [cfgOptionSortImportLists] :: OptionConfig -> !Bool [cfgOptionAlignSumTypeDecl] :: OptionConfig -> !Bool [cfgOptionFlexibleOneline] :: OptionConfig -> !Bool [cfgOptionPreserveVerticalSpace] :: OptionConfig -> !Bool [cfgOptionDeclNoBlankLines] :: OptionConfig -> !Set DeclarationConstruct data Config Config :: !PenaltyConfig -> !AlignConfig -> !IndentConfig -> !LayoutConfig -> !OpConfig -> !GroupConfig -> !OptionConfig -> Config [cfgPenalty] :: Config -> !PenaltyConfig [cfgAlign] :: Config -> !AlignConfig [cfgIndent] :: Config -> !IndentConfig [cfgLayout] :: Config -> !LayoutConfig [cfgOp] :: Config -> !OpConfig [cfgGroup] :: Config -> !GroupConfig [cfgOptions] :: Config -> !OptionConfig defaultConfig :: Config safeConfig :: Config -> Config cfgMapFind :: LayoutContext -> ByteString -> ConfigMap a -> a cfgOpWs :: LayoutContext -> ByteString -> OpConfig -> Whitespace cfgGroupWs :: LayoutContext -> ByteString -> GroupConfig -> Whitespace inWs :: Location -> WsLoc -> Bool wsSpace :: Location -> Whitespace -> Bool wsLinebreak :: Location -> Whitespace -> Bool instance GHC.Generics.Generic Floskell.Config.Config instance GHC.Generics.Generic Floskell.Config.OptionConfig instance GHC.Generics.Generic Floskell.Config.DeclarationConstruct instance GHC.Classes.Ord Floskell.Config.DeclarationConstruct instance GHC.Classes.Eq Floskell.Config.DeclarationConstruct instance GHC.Generics.Generic Floskell.Config.ImportsGroup instance GHC.Generics.Generic Floskell.Config.ImportsGroupOrder instance GHC.Generics.Generic Floskell.Config.GroupConfig instance GHC.Generics.Generic Floskell.Config.OpConfig instance GHC.Generics.Generic Floskell.Config.LayoutConfig instance GHC.Generics.Generic Floskell.Config.IndentConfig instance GHC.Generics.Generic Floskell.Config.AlignConfig instance GHC.Generics.Generic Floskell.Config.PenaltyConfig instance GHC.Generics.Generic (Floskell.Config.ConfigMap a) instance GHC.Show.Show Floskell.Config.ConfigMapKey instance GHC.Classes.Ord Floskell.Config.ConfigMapKey instance GHC.Classes.Eq Floskell.Config.ConfigMapKey instance GHC.Generics.Generic Floskell.Config.Layout instance GHC.Show.Show Floskell.Config.Layout instance GHC.Enum.Enum Floskell.Config.Layout instance GHC.Enum.Bounded Floskell.Config.Layout instance GHC.Classes.Ord Floskell.Config.Layout instance GHC.Classes.Eq Floskell.Config.Layout instance GHC.Generics.Generic Floskell.Config.Whitespace instance GHC.Show.Show Floskell.Config.Whitespace instance GHC.Generics.Generic Floskell.Config.WsLoc instance GHC.Show.Show Floskell.Config.WsLoc instance GHC.Enum.Enum Floskell.Config.WsLoc instance GHC.Enum.Bounded Floskell.Config.WsLoc instance GHC.Classes.Ord Floskell.Config.WsLoc instance GHC.Classes.Eq Floskell.Config.WsLoc instance GHC.Generics.Generic Floskell.Config.Location instance GHC.Show.Show Floskell.Config.Location instance GHC.Enum.Enum Floskell.Config.Location instance GHC.Enum.Bounded Floskell.Config.Location instance GHC.Classes.Ord Floskell.Config.Location instance GHC.Classes.Eq Floskell.Config.Location instance GHC.Generics.Generic Floskell.Config.LayoutContext instance GHC.Show.Show Floskell.Config.LayoutContext instance GHC.Enum.Enum Floskell.Config.LayoutContext instance GHC.Enum.Bounded Floskell.Config.LayoutContext instance GHC.Classes.Ord Floskell.Config.LayoutContext instance GHC.Classes.Eq Floskell.Config.LayoutContext instance GHC.Generics.Generic Floskell.Config.Indent instance GHC.Show.Show Floskell.Config.Indent instance GHC.Classes.Ord Floskell.Config.Indent instance GHC.Classes.Eq Floskell.Config.Indent instance Data.Default.Class.Default Floskell.Config.Config instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.Config instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.Config instance Data.Default.Class.Default Floskell.Config.OptionConfig instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.OptionConfig instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.OptionConfig instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.DeclarationConstruct instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.DeclarationConstruct instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.SortImportsRule instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.SortImportsRule instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.ImportsGroup instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.ImportsGroup instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.ImportsGroupOrder instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.ImportsGroupOrder instance Data.Default.Class.Default Floskell.Config.GroupConfig instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.GroupConfig instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.GroupConfig instance Data.Default.Class.Default Floskell.Config.OpConfig instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.OpConfig instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.OpConfig instance Data.Default.Class.Default Floskell.Config.LayoutConfig instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.LayoutConfig instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.LayoutConfig instance Data.Default.Class.Default Floskell.Config.IndentConfig instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.IndentConfig instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.IndentConfig instance Data.Default.Class.Default Floskell.Config.AlignConfig instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.AlignConfig instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.AlignConfig instance Data.Default.Class.Default Floskell.Config.PenaltyConfig instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.PenaltyConfig instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.PenaltyConfig instance Data.Aeson.Types.ToJSON.ToJSON a => Data.Aeson.Types.ToJSON.ToJSON (Floskell.Config.ConfigMap a) instance Data.Aeson.Types.FromJSON.FromJSON a => Data.Aeson.Types.FromJSON.FromJSON (Floskell.Config.ConfigMap a) instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.Layout instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.Layout instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.Whitespace instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.Whitespace instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.WsLoc instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.WsLoc instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.LayoutContext instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.LayoutContext instance Data.Aeson.Types.ToJSON.ToJSON Floskell.Config.Indent instance Data.Aeson.Types.FromJSON.FromJSON Floskell.Config.Indent module Floskell.Fixities builtinFixities :: [Fixity] packageFixities :: [(String, [Fixity])] module Floskell.Imports sortImports :: [ImportDecl a] -> [ImportDecl a] groupImports :: Int -> [ImportDecl a] -> [[ImportDecl a]] splitImports :: [ImportsGroup] -> [ImportDecl a] -> [[ImportDecl a]] module Floskell.Styles -- | A printer style. data Style Style :: !Text -> !Text -> !Text -> !Config -> Style -- | Name of the style, used in the commandline interface. [styleName] :: Style -> !Text -- | Author of the style definition. [styleAuthor] :: Style -> !Text -- | Description of the style. [styleDescription] :: Style -> !Text -- | Style definition. [styleConfig] :: Style -> !Config -- | Styles list, useful for programmatically choosing. styles :: [Style] module Floskell.ConfigFile data AppConfig AppConfig :: Style -> Language -> [Extension] -> [Fixity] -> AppConfig [appStyle] :: AppConfig -> Style [appLanguage] :: AppConfig -> Language [appExtensions] :: AppConfig -> [Extension] [appFixities] :: AppConfig -> [Fixity] -- | Default program configuration. defaultAppConfig :: AppConfig -- | Try to find a configuration file based on current working directory, -- or in one of the application configuration directories. findAppConfig :: IO (Maybe FilePath) findAppConfigIn :: FilePath -> IO (Maybe FilePath) -- | Load a configuration file. readAppConfig :: FilePath -> IO AppConfig -- | Show name of a style. showStyle :: Style -> String -- | Show a Haskell language name. showLanguage :: Language -> String -- | Show a Haskell language extension. showExtension :: Extension -> String -- | Show a fixity declaration. showFixity :: Fixity -> String -- | Lookup a style by name. lookupStyle :: String -> Style -- | Lookup a language by name. lookupLanguage :: String -> Language -- | Lookup an extension by name. lookupExtension :: String -> Extension -- | Parse a fixity declaration. lookupFixity :: String -> Fixity setStyle :: AppConfig -> Maybe String -> AppConfig setLanguage :: AppConfig -> Maybe String -> AppConfig setExtensions :: AppConfig -> [String] -> AppConfig setFixities :: AppConfig -> [String] -> AppConfig instance GHC.Generics.Generic Floskell.ConfigFile.AppConfig instance Data.Aeson.Types.ToJSON.ToJSON Floskell.ConfigFile.AppConfig instance Data.Aeson.Types.FromJSON.FromJSON Floskell.ConfigFile.AppConfig -- | All types. module Floskell.Types data OutputRestriction Anything :: OutputRestriction NoOverflow :: OutputRestriction NoOverflowOrLinebreak :: OutputRestriction data TypeLayout TypeFree :: TypeLayout TypeFlex :: TypeLayout TypeVertical :: TypeLayout newtype Penalty Penalty :: Int -> Penalty newtype TabStop TabStop :: String -> TabStop -- | A pretty printing monad. newtype Printer a Printer :: StateT PrintState (Search Penalty) a -> Printer a [unPrinter] :: Printer a -> StateT PrintState (Search Penalty) a execPrinter :: Printer a -> PrintState -> Maybe (Penalty, PrintState) runPrinter :: Printer a -> PrintState -> Maybe (Penalty, (a, PrintState)) -- | The state of the pretty printer. data PrintState PrintState :: !Buffer -> !Int -> !Int -> !Map TabStop Int -> !Config -> !Bool -> !OutputRestriction -> !TypeLayout -> PrintState -- | Output buffer [psBuffer] :: PrintState -> !Buffer -- | Current indentation level. [psIndentLevel] :: PrintState -> !Int -- | Extra indentation is necessary with next line break. [psOnside] :: PrintState -> !Int -- | Tab stops for alignment. [psTabStops] :: PrintState -> !Map TabStop Int -- | Style definition. [psConfig] :: PrintState -> !Config -- | An end of line comment has just been outputted. [psEolComment] :: PrintState -> !Bool [psOutputRestriction] :: PrintState -> !OutputRestriction [psTypeLayout] :: PrintState -> !TypeLayout psLine :: PrintState -> Int psColumn :: PrintState -> Int psNewline :: PrintState -> Bool initialPrintState :: Config -> PrintState data Config Config :: !PenaltyConfig -> !AlignConfig -> !IndentConfig -> !LayoutConfig -> !OpConfig -> !GroupConfig -> !OptionConfig -> Config [cfgPenalty] :: Config -> !PenaltyConfig [cfgAlign] :: Config -> !AlignConfig [cfgIndent] :: Config -> !IndentConfig [cfgLayout] :: Config -> !LayoutConfig [cfgOp] :: Config -> !OpConfig [cfgGroup] :: Config -> !GroupConfig [cfgOptions] :: Config -> !OptionConfig -- | A portion of the source, spanning one or more lines and zero or more -- columns. data SrcSpan SrcSpan :: String -> Int -> Int -> Int -> Int -> SrcSpan [srcSpanFilename] :: SrcSpan -> String [srcSpanStartLine] :: SrcSpan -> Int [srcSpanStartColumn] :: SrcSpan -> Int [srcSpanEndLine] :: SrcSpan -> Int [srcSpanEndColumn] :: SrcSpan -> Int data CommentType InlineComment :: CommentType LineComment :: CommentType PreprocessorDirective :: CommentType data Comment Comment :: !CommentType -> !SrcSpan -> !String -> Comment [commentType] :: Comment -> !CommentType [commentSpan] :: Comment -> !SrcSpan [commentText] :: Comment -> !String -- | Information for each node in the AST. data NodeInfo NodeInfo :: !SrcSpan -> ![Comment] -> ![Comment] -> NodeInfo -- | Location info from the parser. [nodeInfoSpan] :: NodeInfo -> !SrcSpan -- | Leading comments attached to this node. [nodeInfoLeadingComments] :: NodeInfo -> ![Comment] -- | Trailing comments attached to this node. [nodeInfoTrailingComments] :: NodeInfo -> ![Comment] -- | Empty NodeInfo noNodeInfo :: NodeInfo nodeSpan :: Annotated ast => ast NodeInfo -> SrcSpan data Location Before :: Location After :: Location instance GHC.Show.Show Floskell.Types.NodeInfo instance GHC.Show.Show Floskell.Types.Comment instance GHC.Show.Show Floskell.Types.CommentType instance GHC.Base.Alternative Floskell.Types.Printer instance GHC.Base.MonadPlus Floskell.Types.Printer instance Control.Monad.Search.MonadSearch Floskell.Types.Penalty Floskell.Types.Printer instance Control.Monad.State.Class.MonadState Floskell.Types.PrintState Floskell.Types.Printer instance GHC.Base.Functor Floskell.Types.Printer instance GHC.Base.Monad Floskell.Types.Printer instance GHC.Base.Applicative Floskell.Types.Printer instance GHC.Show.Show Floskell.Types.TabStop instance GHC.Classes.Ord Floskell.Types.TabStop instance GHC.Classes.Eq Floskell.Types.TabStop instance GHC.Show.Show Floskell.Types.Penalty instance GHC.Num.Num Floskell.Types.Penalty instance GHC.Classes.Ord Floskell.Types.Penalty instance GHC.Classes.Eq Floskell.Types.Penalty instance GHC.Show.Show Floskell.Types.TypeLayout instance GHC.Classes.Ord Floskell.Types.TypeLayout instance GHC.Classes.Eq Floskell.Types.TypeLayout instance GHC.Show.Show Floskell.Types.OutputRestriction instance GHC.Classes.Ord Floskell.Types.OutputRestriction instance GHC.Classes.Eq Floskell.Types.OutputRestriction instance GHC.Base.Semigroup Floskell.Types.Penalty instance GHC.Base.Monoid Floskell.Types.Penalty module Floskell.Printers -- | Query part of the pretty printer config getConfig :: (Config -> b) -> Printer b -- | Query pretty printer options getOption :: (OptionConfig -> a) -> Printer a -- | Try only the first (i.e. locally best) solution to the given pretty -- printer. Use this function to improve performance whenever the -- formatting of an AST node has no effect on the penalty of any -- following AST node, such as top-level declarations or case branches. cut :: Printer a -> Printer a oneline :: Printer a -> Printer a ignoreOneline :: Printer a -> Printer a -- | Write out a string, updating the current position information. write :: ByteString -> Printer () -- | Write a string. string :: String -> Printer () -- | Write an integral. int :: Int -> Printer () -- | Write a space. space :: Printer () -- | Output a newline. newline :: Printer () blankline :: Printer () spaceOrNewline :: Printer () withTabStops :: [(TabStop, Maybe Int)] -> Printer a -> Printer a atTabStop :: TabStop -> Printer () mayM_ :: Maybe a -> (a -> Printer ()) -> Printer () withPrefix :: Applicative f => f a -> (x -> f b) -> x -> f b withPostfix :: Applicative f => f a -> (x -> f b) -> x -> f b withIndentConfig :: (IndentConfig -> Indent) -> Printer a -> (Int -> Printer a) -> Printer a withIndent :: (IndentConfig -> Indent) -> Printer a -> Printer a withIndentFlex :: (IndentConfig -> Indent) -> Printer a -> Printer a withIndentAfter :: (IndentConfig -> Indent) -> Printer () -> Printer a -> Printer a withIndentBy :: (IndentConfig -> Int) -> Printer a -> Printer a withLayout :: (LayoutConfig -> Layout) -> Printer a -> Printer a -> Printer a inter :: Printer () -> [Printer ()] -> Printer () -- | Get the column for the next printed character. getNextColumn :: Printer Int -- | Set the (newline-) indent level to the given column for the given -- printer. column :: Int -> Printer a -> Printer a aligned :: Printer a -> Printer a indented :: Printer a -> Printer a -- | Increase indentation level by n spaces for the given printer. indentedBy :: Int -> Printer a -> Printer a -- | Increase indentation level b n spaces for the given printer, but -- ignore increase when computing further indentations. onside :: Printer a -> Printer a depend :: ByteString -> Printer a -> Printer a depend' :: Printer () -> Printer a -> Printer a -- | Wrap in parens. parens :: Printer () -> Printer () -- | Wrap in brackets. brackets :: Printer () -> Printer () group :: LayoutContext -> ByteString -> ByteString -> Printer () -> Printer () groupH :: LayoutContext -> ByteString -> ByteString -> Printer () -> Printer () groupV :: LayoutContext -> ByteString -> ByteString -> Printer () -> Printer () operator :: LayoutContext -> ByteString -> Printer () operatorH :: LayoutContext -> ByteString -> Printer () operatorV :: LayoutContext -> ByteString -> Printer () alignOnOperator :: LayoutContext -> ByteString -> Printer a -> Printer a alignOnOperatorH :: LayoutContext -> ByteString -> Printer a -> Printer a alignOnOperatorV :: LayoutContext -> ByteString -> Printer a -> Printer a withOperatorFormatting :: LayoutContext -> ByteString -> Printer () -> (Printer () -> Printer a) -> Printer a withOperatorFormattingH :: LayoutContext -> ByteString -> Printer () -> (Printer () -> Printer a) -> Printer a withOperatorFormattingV :: LayoutContext -> ByteString -> Printer () -> (Printer () -> Printer a) -> Printer a operatorSectionL :: LayoutContext -> ByteString -> Printer () -> Printer () operatorSectionR :: LayoutContext -> ByteString -> Printer () -> Printer () comma :: Printer () module Floskell.Pretty -- | Type class for pretty-printable types. class Pretty ast prettyPrint :: Pretty ast => ast NodeInfo -> Printer () prettyPrint :: (Pretty ast, Pretty (ast NodeInfo)) => ast NodeInfo -> Printer () -- | Pretty print a syntax tree with annotated comments pretty :: (Annotated ast, Pretty ast) => ast NodeInfo -> Printer () instance Language.Haskell.Exts.Syntax.Annotated Floskell.Pretty.CompactBinds instance GHC.Base.Functor Floskell.Pretty.CompactBinds instance Language.Haskell.Exts.Syntax.Annotated Floskell.Pretty.GuardedAlts instance GHC.Base.Functor Floskell.Pretty.GuardedAlts instance Language.Haskell.Exts.Syntax.Annotated Floskell.Pretty.GuardedAlt instance GHC.Base.Functor Floskell.Pretty.GuardedAlt instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Exp instance GHC.Base.Functor a => GHC.Base.Functor (Floskell.Pretty.MayAst a) instance Language.Haskell.Exts.Syntax.Annotated a => Language.Haskell.Exts.Syntax.Annotated (Floskell.Pretty.MayAst a) instance (Language.Haskell.Exts.Syntax.Annotated a, Floskell.Pretty.Pretty a) => Floskell.Pretty.Pretty (Floskell.Pretty.MayAst a) instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Stmt instance Floskell.Pretty.Pretty Floskell.Pretty.CompactBinds instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Alt instance Floskell.Pretty.Pretty Floskell.Pretty.GuardedAlts instance Floskell.Pretty.Pretty Floskell.Pretty.GuardedAlt instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Module instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ModuleHead instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.WarningText instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ExportSpecList instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ExportSpec instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ImportDecl instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ImportSpecList instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ImportSpec instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Assoc instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Decl instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.DeclHead instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.InstRule instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.InstHead instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Binds instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.IPBind instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.InjectivityInfo instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ResultSig instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ClassDecl instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.InstDecl instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Deriving instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ConDecl instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.FieldDecl instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.QualConDecl instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.GadtDecl instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Match instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Rhs instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.GuardedRhs instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Context instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.FunDep instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Asst instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Type instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.TyVarBind instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.TypeEqn instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.XAttr instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Pat instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.PatField instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.PXAttr instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Literal instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.QualStmt instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.FieldUpdate instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.QOp instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Op instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Bracket instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Splice instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ModulePragma instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Rule instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.RuleVar instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Activation instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Annotation instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.BooleanFormula instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.DerivStrategy instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.DataOrNew instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.BangType instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Unpackedness instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.RPat instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.ModuleName instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.QName instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Name instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.IPName instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.XName instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Safety instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.CallConv instance Floskell.Pretty.Pretty Language.Haskell.Exts.Syntax.Overlap -- | Comment handling. module Floskell.Comments -- | Annotate the AST with comments. annotateWithComments :: Traversable ast => ast SrcSpanInfo -> [Comment] -> ast NodeInfo instance GHC.Classes.Eq Floskell.Comments.OrderByEnd instance GHC.Classes.Eq Floskell.Comments.OrderByStart instance GHC.Classes.Ord Floskell.Comments.OrderByEnd instance GHC.Classes.Ord Floskell.Comments.OrderByStart -- | Haskell indenter. module Floskell data AppConfig AppConfig :: Style -> Language -> [Extension] -> [Fixity] -> AppConfig [appStyle] :: AppConfig -> Style [appLanguage] :: AppConfig -> Language [appExtensions] :: AppConfig -> [Extension] [appFixities] :: AppConfig -> [Fixity] -- | Default program configuration. defaultAppConfig :: AppConfig -- | Try to find a configuration file based on current working directory, -- or in one of the application configuration directories. findAppConfig :: IO (Maybe FilePath) findAppConfigIn :: FilePath -> IO (Maybe FilePath) -- | Load a configuration file. readAppConfig :: FilePath -> IO AppConfig setStyle :: AppConfig -> Maybe String -> AppConfig setLanguage :: AppConfig -> Maybe String -> AppConfig setExtensions :: AppConfig -> [String] -> AppConfig setFixities :: AppConfig -> [String] -> AppConfig -- | Format the given source. reformat :: AppConfig -> Maybe FilePath -> ByteString -> Either String ByteString -- | A printer style. data Style Style :: !Text -> !Text -> !Text -> !Config -> Style -- | Name of the style, used in the commandline interface. [styleName] :: Style -> !Text -- | Author of the style definition. [styleAuthor] :: Style -> !Text -- | Description of the style. [styleDescription] :: Style -> !Text -- | Style definition. [styleConfig] :: Style -> !Config -- | Styles list, useful for programmatically choosing. styles :: [Style] -- | Default extensions. defaultExtensions :: [Extension] instance GHC.Classes.Eq Floskell.CodeBlock instance GHC.Show.Show Floskell.CodeBlock