language-python-0.5.6: Parsing and pretty printing of Python code.

Copyright(c) 2009 Bernie Pope
LicenseBSD-style
Maintainerbjpop@csse.unimelb.edu.au
Stabilityexperimental
Portabilityghc
Safe HaskellSafe
LanguageHaskell98

Language.Python.Common.Pretty

Description

Convenience class for pretty printing combinators.

Synopsis

Documentation

class Pretty a where Source #

All types which can be transformed into a Doc.

Methods

pretty :: a -> Doc Source #

Instances
Pretty Bool Source # 
Instance details

Defined in Language.Python.Common.Pretty

Methods

pretty :: Bool -> Doc Source #

Pretty Double Source # 
Instance details

Defined in Language.Python.Common.Pretty

Methods

pretty :: Double -> Doc Source #

Pretty Int Source # 
Instance details

Defined in Language.Python.Common.Pretty

Methods

pretty :: Int -> Doc Source #

Pretty Integer Source # 
Instance details

Defined in Language.Python.Common.Pretty

Methods

pretty :: Integer -> Doc Source #

Pretty String Source # 
Instance details

Defined in Language.Python.Common.Pretty

Methods

pretty :: String -> Doc Source #

Pretty SrcSpan Source # 
Instance details

Defined in Language.Python.Common.SrcLocation

Methods

pretty :: SrcSpan -> Doc Source #

Pretty SrcLocation Source # 
Instance details

Defined in Language.Python.Common.SrcLocation

Pretty Token Source # 
Instance details

Defined in Language.Python.Common.PrettyToken

Methods

pretty :: Token -> Doc Source #

Pretty ParseError Source # 
Instance details

Defined in Language.Python.Common.PrettyParseError

Pretty a => Pretty (Maybe a) Source # 
Instance details

Defined in Language.Python.Common.Pretty

Methods

pretty :: Maybe a -> Doc Source #

Pretty (AssignOp a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: AssignOp a -> Doc Source #

Pretty (Op a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Op a -> Doc Source #

Pretty (Slice a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Slice a -> Doc Source #

Pretty (DictKeyDatumList a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Pretty (YieldArg a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: YieldArg a -> Doc Source #

Pretty (Expr a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Expr a -> Doc Source #

Pretty (CompIter a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: CompIter a -> Doc Source #

Pretty (CompIf a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: CompIf a -> Doc Source #

Pretty (CompFor a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: CompFor a -> Doc Source #

Pretty (ComprehensionExpr a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Pretty (Comprehension a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Pretty (ExceptClause a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: ExceptClause a -> Doc Source #

Pretty (Handler a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Handler a -> Doc Source #

Pretty (Argument a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Argument a -> Doc Source #

Pretty (ParamTuple a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: ParamTuple a -> Doc Source #

Pretty (Parameter a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Parameter a -> Doc Source #

Pretty (Decorator a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Decorator a -> Doc Source #

Pretty (RaiseExpr a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: RaiseExpr a -> Doc Source #

Pretty (Statement a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Statement a -> Doc Source #

Pretty (ImportRelative a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Pretty (FromItems a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: FromItems a -> Doc Source #

Pretty (FromItem a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: FromItem a -> Doc Source #

Pretty (ImportItem a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: ImportItem a -> Doc Source #

Pretty (Module a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Module a -> Doc Source #

Pretty (Ident a) Source # 
Instance details

Defined in Language.Python.Common.PrettyAST

Methods

pretty :: Ident a -> Doc Source #

prettyText :: Pretty a => a -> String Source #

Transform values into strings.

prettyPrefix :: Pretty a => Int -> a -> Doc Source #

Print just the prefix of something

parensIf :: Pretty a => (a -> Bool) -> a -> Doc Source #

Conditionally wrap parentheses around an item.

perhaps :: Pretty a => Maybe a -> Doc -> Doc Source #

commaList :: Pretty a => [a] -> Doc Source #

A list of things separated by commas.

equalsList :: Pretty a => [a] -> Doc Source #

A list of things separated by equals signs.