Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- run :: (a -> a -> Bool) -> [a] -> ([a], [a])
- runs :: (a -> a -> Bool) -> [a] -> [[a]]
- stopImportModule :: TabStop
- stopImportSpec :: TabStop
- stopRecordField :: TabStop
- stopRhs :: TabStop
- flattenApp :: Annotated ast => (ast NodeInfo -> Maybe (ast NodeInfo, ast NodeInfo)) -> ast NodeInfo -> [ast NodeInfo]
- flattenInfix :: (Annotated ast1, Annotated ast2) => (ast1 NodeInfo -> Maybe (ast1 NodeInfo, ast2 NodeInfo, ast1 NodeInfo)) -> ast1 NodeInfo -> (ast1 NodeInfo, [(ast2 NodeInfo, ast1 NodeInfo)])
- type PrettyPrinter f = f NodeInfo -> Printer ()
- prettyHSE :: Pretty (ast NodeInfo) => PrettyPrinter ast
- class Pretty ast where
- prettyPrint :: PrettyPrinter ast
- pretty :: (Annotated ast, Pretty ast) => PrettyPrinter ast
- prettyOnside :: (Annotated ast, Pretty ast) => PrettyPrinter ast
- noNodeInfo :: NodeInfo
- compareAST :: (Functor ast, Ord (ast ())) => ast NodeInfo -> ast NodeInfo -> Ordering
- filterComments :: Annotated a => (Maybe Location -> Bool) -> a NodeInfo -> [ComInfo]
- copyComments :: (Annotated ast1, Annotated ast2) => Location -> ast1 NodeInfo -> ast2 NodeInfo -> ast2 NodeInfo
- printComment :: Maybe SrcSpan -> Comment -> Printer ()
- printComments :: Annotated ast => Location -> ast NodeInfo -> Printer ()
- opName :: QOp a -> ByteString
- opName' :: QName a -> ByteString
- lineDelta :: Annotated ast => ast NodeInfo -> ast NodeInfo -> Int
- linedFn :: Annotated ast => (ast NodeInfo -> Printer ()) -> [ast NodeInfo] -> Printer ()
- lined :: (Annotated ast, Pretty ast) => [ast NodeInfo] -> Printer ()
- linedOnside :: (Annotated ast, Pretty ast) => [ast NodeInfo] -> Printer ()
- listVinternal :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> [ast NodeInfo] -> Printer ()
- listH :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> ByteString -> ByteString -> [ast NodeInfo] -> Printer ()
- listV :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> ByteString -> ByteString -> [ast NodeInfo] -> Printer ()
- list :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> ByteString -> ByteString -> [ast NodeInfo] -> Printer ()
- listH' :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> [ast NodeInfo] -> Printer ()
- listV' :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> [ast NodeInfo] -> Printer ()
- list' :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> [ast NodeInfo] -> Printer ()
- listAutoWrap :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> ByteString -> ByteString -> [ast NodeInfo] -> Printer ()
- measure :: Printer a -> Printer (Maybe Int)
- measureDecl :: Decl NodeInfo -> Printer (Maybe [Int])
- measureClassDecl :: ClassDecl NodeInfo -> Printer (Maybe [Int])
- measureInstDecl :: InstDecl NodeInfo -> Printer (Maybe [Int])
- measureAlt :: Alt NodeInfo -> Printer (Maybe [Int])
- withComputedTabStop :: TabStop -> (AlignConfig -> Bool) -> (a -> Printer (Maybe [Int])) -> [a] -> Printer b -> Printer b
- moduleName :: ModuleName a -> String
- nameLength :: Name a -> Int
- qnameLength :: QName a -> Int
- prettyPragmas :: [ModulePragma NodeInfo] -> Printer ()
- prettyImports :: [ImportDecl NodeInfo] -> Printer ()
- skipBlank :: Annotated ast => (ast NodeInfo -> ast NodeInfo -> Bool) -> ast NodeInfo -> ast NodeInfo -> Bool
- skipBlankAfterDecl :: Decl a -> Bool
- skipBlankDecl :: Decl NodeInfo -> Decl NodeInfo -> Bool
- skipBlankClassDecl :: ClassDecl NodeInfo -> ClassDecl NodeInfo -> Bool
- skipBlankInstDecl :: InstDecl NodeInfo -> InstDecl NodeInfo -> Bool
- prettyDecls :: (Annotated ast, Pretty ast) => (ast NodeInfo -> ast NodeInfo -> Bool) -> [ast NodeInfo] -> Printer ()
- prettySimpleDecl :: (Annotated ast1, Pretty ast1, Annotated ast2, Pretty ast2) => ast1 NodeInfo -> ByteString -> ast2 NodeInfo -> Printer ()
- prettyConDecls :: (Annotated ast, Pretty ast) => [ast NodeInfo] -> Printer ()
- prettyForall :: (Annotated ast, Pretty ast) => [ast NodeInfo] -> Printer ()
- prettyTypesig :: (Annotated ast, Pretty ast) => LayoutContext -> [ast NodeInfo] -> Type NodeInfo -> Printer ()
- prettyApp :: (Annotated ast1, Annotated ast2, Pretty ast1, Pretty ast2) => ast1 NodeInfo -> [ast2 NodeInfo] -> Printer ()
- prettyInfixApp :: (Annotated ast, Pretty ast, Pretty (op NodeInfo)) => (op NodeInfo -> ByteString) -> LayoutContext -> (ast NodeInfo, [(op NodeInfo, ast NodeInfo)]) -> Printer ()
- prettyRecord :: (Annotated ast1, Pretty ast1, Annotated ast2, Pretty ast2) => (ast2 NodeInfo -> Printer (Maybe Int)) -> LayoutContext -> ast1 NodeInfo -> [ast2 NodeInfo] -> Printer ()
- prettyRecordFields :: (Annotated ast, Pretty ast) => (ast NodeInfo -> Printer (Maybe Int)) -> LayoutContext -> [ast NodeInfo] -> Printer ()
- prettyPragma :: ByteString -> Printer () -> Printer ()
- prettyPragma' :: ByteString -> Maybe (Printer ()) -> Printer ()
- newtype GuardedAlt l = GuardedAlt (GuardedRhs l)
- newtype GuardedAlts l = GuardedAlts (Rhs l)
- newtype CompactBinds l = CompactBinds (Binds l)
- newtype MayAst a l = MayAst (Maybe (a l))
Documentation
flattenApp :: Annotated ast => (ast NodeInfo -> Maybe (ast NodeInfo, ast NodeInfo)) -> ast NodeInfo -> [ast NodeInfo] Source #
flattenInfix :: (Annotated ast1, Annotated ast2) => (ast1 NodeInfo -> Maybe (ast1 NodeInfo, ast2 NodeInfo, ast1 NodeInfo)) -> ast1 NodeInfo -> (ast1 NodeInfo, [(ast2 NodeInfo, ast1 NodeInfo)]) Source #
type PrettyPrinter f = f NodeInfo -> Printer () Source #
Syntax shortcut for Pretty Printers.
prettyHSE :: Pretty (ast NodeInfo) => PrettyPrinter ast Source #
Pretty printing prettyHSE using haskell-src-exts pretty printer
class Pretty ast where Source #
Type class for pretty-printable types.
Nothing
prettyPrint :: PrettyPrinter ast Source #
prettyPrint :: Pretty (ast NodeInfo) => PrettyPrinter ast Source #
Instances
pretty :: (Annotated ast, Pretty ast) => PrettyPrinter ast Source #
Pretty print a syntax tree with annotated comments
prettyOnside :: (Annotated ast, Pretty ast) => PrettyPrinter ast Source #
noNodeInfo :: NodeInfo Source #
Empty NodeInfo
compareAST :: (Functor ast, Ord (ast ())) => ast NodeInfo -> ast NodeInfo -> Ordering Source #
Compare two AST nodes ignoring the annotation
filterComments :: Annotated a => (Maybe Location -> Bool) -> a NodeInfo -> [ComInfo] Source #
Return comments with matching location.
copyComments :: (Annotated ast1, Annotated ast2) => Location -> ast1 NodeInfo -> ast2 NodeInfo -> ast2 NodeInfo Source #
Copy comments from one AST node to another.
printComments :: Annotated ast => Location -> ast NodeInfo -> Printer () Source #
Print comments of a node.
opName :: QOp a -> ByteString Source #
Return the configuration name of an operator
opName' :: QName a -> ByteString Source #
Return the configuration name of an operator
listVinternal :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> [ast NodeInfo] -> Printer () Source #
listH :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> ByteString -> ByteString -> [ast NodeInfo] -> Printer () Source #
listV :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> ByteString -> ByteString -> [ast NodeInfo] -> Printer () Source #
list :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> ByteString -> ByteString -> [ast NodeInfo] -> Printer () Source #
listH' :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> [ast NodeInfo] -> Printer () Source #
listV' :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> [ast NodeInfo] -> Printer () Source #
list' :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> [ast NodeInfo] -> Printer () Source #
listAutoWrap :: (Annotated ast, Pretty ast) => LayoutContext -> ByteString -> ByteString -> ByteString -> [ast NodeInfo] -> Printer () Source #
withComputedTabStop :: TabStop -> (AlignConfig -> Bool) -> (a -> Printer (Maybe [Int])) -> [a] -> Printer b -> Printer b Source #
moduleName :: ModuleName a -> String Source #
Extract the name as a String from a ModuleName
nameLength :: Name a -> Int Source #
qnameLength :: QName a -> Int Source #
prettyPragmas :: [ModulePragma NodeInfo] -> Printer () Source #
prettyImports :: [ImportDecl NodeInfo] -> Printer () Source #
skipBlank :: Annotated ast => (ast NodeInfo -> ast NodeInfo -> Bool) -> ast NodeInfo -> ast NodeInfo -> Bool Source #
skipBlankAfterDecl :: Decl a -> Bool Source #
prettyDecls :: (Annotated ast, Pretty ast) => (ast NodeInfo -> ast NodeInfo -> Bool) -> [ast NodeInfo] -> Printer () Source #
prettySimpleDecl :: (Annotated ast1, Pretty ast1, Annotated ast2, Pretty ast2) => ast1 NodeInfo -> ByteString -> ast2 NodeInfo -> Printer () Source #
prettyTypesig :: (Annotated ast, Pretty ast) => LayoutContext -> [ast NodeInfo] -> Type NodeInfo -> Printer () Source #
prettyApp :: (Annotated ast1, Annotated ast2, Pretty ast1, Pretty ast2) => ast1 NodeInfo -> [ast2 NodeInfo] -> Printer () Source #
prettyInfixApp :: (Annotated ast, Pretty ast, Pretty (op NodeInfo)) => (op NodeInfo -> ByteString) -> LayoutContext -> (ast NodeInfo, [(op NodeInfo, ast NodeInfo)]) -> Printer () Source #
prettyRecord :: (Annotated ast1, Pretty ast1, Annotated ast2, Pretty ast2) => (ast2 NodeInfo -> Printer (Maybe Int)) -> LayoutContext -> ast1 NodeInfo -> [ast2 NodeInfo] -> Printer () Source #
prettyRecordFields :: (Annotated ast, Pretty ast) => (ast NodeInfo -> Printer (Maybe Int)) -> LayoutContext -> [ast NodeInfo] -> Printer () Source #
prettyPragma :: ByteString -> Printer () -> Printer () Source #
prettyPragma' :: ByteString -> Maybe (Printer ()) -> Printer () Source #
newtype GuardedAlt l Source #
GuardedAlt (GuardedRhs l) |
Instances
Functor GuardedAlt Source # | |
Defined in Floskell.Pretty fmap :: (a -> b) -> GuardedAlt a -> GuardedAlt b # (<$) :: a -> GuardedAlt b -> GuardedAlt a # | |
Annotated GuardedAlt Source # | |
Defined in Floskell.Pretty ann :: GuardedAlt l -> l # amap :: (l -> l) -> GuardedAlt l -> GuardedAlt l # | |
Pretty GuardedAlt Source # | |
Defined in Floskell.Pretty |
newtype GuardedAlts l Source #
GuardedAlts (Rhs l) |
Instances
Functor GuardedAlts Source # | |
Defined in Floskell.Pretty fmap :: (a -> b) -> GuardedAlts a -> GuardedAlts b # (<$) :: a -> GuardedAlts b -> GuardedAlts a # | |
Annotated GuardedAlts Source # | |
Defined in Floskell.Pretty ann :: GuardedAlts l -> l # amap :: (l -> l) -> GuardedAlts l -> GuardedAlts l # | |
Pretty GuardedAlts Source # | |
Defined in Floskell.Pretty |
newtype CompactBinds l Source #
CompactBinds (Binds l) |
Instances
Functor CompactBinds Source # | |
Defined in Floskell.Pretty fmap :: (a -> b) -> CompactBinds a -> CompactBinds b # (<$) :: a -> CompactBinds b -> CompactBinds a # | |
Annotated CompactBinds Source # | |
Defined in Floskell.Pretty ann :: CompactBinds l -> l # amap :: (l -> l) -> CompactBinds l -> CompactBinds l # | |
Pretty CompactBinds Source # | |
Defined in Floskell.Pretty |