language-fortran-0.5.1: Fortran lexer and parser, language support, and extensions.

Safe HaskellNone
LanguageHaskell98

Language.Fortran.Pretty

Contents

Synopsis

Documentation

pprint :: PrettyPrintable t => t -> String Source

Core pretty-printing primitive

data DefaultPP Source

Define default pretty-print version constructor

Constructors

DefaultPP 

class PPVersion a Source

The set of all types which can be used to switch between pretty printer versions

class PrintMaster t v where Source

Master print behaviour

Methods

printMaster :: (?variant :: v) => t -> String Source

Instances

PPVersion v => PrintMaster String v Source

Definition of the master pretty printer which, notably, is defined for all versions v.

(PPVersion v, PrintSlave (ProgUnit p) v) => PrintMaster [ProgUnit p] v Source 
(PrintSlave (Expr p) v, PPVersion v) => PrintMaster (Spec p) v Source 
PPVersion v => PrintMaster (UnaryOp p) v Source 
PPVersion v => PrintMaster (BinOp p) v Source 
(PrintSlave (ArgList p) v, PrintSlave (BinOp p) v, PrintSlave (Expr p) v, PrintSlave (UnaryOp p) v, PrintSlave (VarName p) v, PPVersion v) => PrintMaster (Expr p) v Source 
(PrintIndMaster (Fortran p) v, PPVersion v) => PrintMaster (Fortran p) v Source 
PrintSlave (Expr p) v => PrintMaster (DataForm p) v Source 
(PrintSlave (Arg p) v, PrintSlave (Decl p) v, PrintSlave (Implicit p) v, PrintSlave (SubName p) v, PPVersion v) => PrintMaster (InterfaceSpec p) v Source 
(PrintSlave (Arg p) v, PrintSlave (BinOp p) v, PrintSlave (Expr p) v, PPVersion v) => PrintMaster (GSpec p) v Source 
PPVersion v => PrintMaster (Fraction p) v Source 
PPVersion v => PrintMaster (MeasureUnitSpec p) v Source 
(PrintSlave (ArgList p) v, PrintSlave (BinOp p) v, PrintSlave (Expr p) v, PrintSlave (UnaryOp p) v, PrintSlave (VarName p) v, PrintSlave (MeasureUnitSpec p) v, PPVersion v) => PrintMaster (Attr p) v Source 
(PrintSlave (SubName p) v, PPVersion v) => PrintMaster (BaseType p) v Source 
(PrintSlave (ArgList p) v, PrintSlave (BinOp p) v, PrintSlave (UnaryOp p) v, PrintSlave (BaseType p) v, PrintSlave (Expr p) v, PrintSlave (MeasureUnitSpec p) v, PrintSlave (VarName p) v, PPVersion v) => PrintMaster (Type p) v Source 
(Indentor (Decl p), PrintSlave (Arg p) v, PrintSlave (ArgList p) v, PrintSlave (Attr p) v, PrintSlave (BinOp p) v, PrintSlave (Decl p) v, PrintSlave (DataForm p) v, PrintSlave (Expr p) v, PrintSlave (GSpec p) v, PrintSlave (Implicit p) v, PrintSlave (InterfaceSpec p) v, PrintSlave (MeasureUnitSpec p) v, PrintSlave (SubName p) v, PrintSlave (UnaryOp p) v, PrintSlave (VarName p) v, PrintSlave (Type p) v, PPVersion v) => PrintMaster (Decl p) v Source 
(PrintSlave (Fortran p) v, PrintSlave (Decl p) v, PrintSlave (Implicit p) v, PPVersion v) => PrintMaster (Block p) v Source 
PPVersion v => PrintMaster (Uses p) v Source 
(PPVersion v, PrintMaster (Uses p) v) => PrintMaster (UseBlock p) v Source 
PPVersion v => PrintMaster (Implicit p) v Source 
(PrintSlave (Arg p) v, PrintSlave (BaseType p) v, PrintSlave (Block p) v, PrintSlave (Decl p) v, PrintSlave (Fortran p) v, PrintSlave (Implicit p) v, PrintSlave (SubName p) v, PrintSlave (VarName p) v, PrintSlave (ProgUnit p) v, PPVersion v) => PrintMaster (ProgUnit p) v Source 
(PrintSlave (Expr p) v, PPVersion v) => PrintMaster (ArgList p) v Source 
(PrintSlave (ArgName p) v, PPVersion v) => PrintMaster (Arg p) v Source 
(PrintSlave (VarName p) v, PrintSlave (ArgName p) v, PPVersion v) => PrintMaster (ArgName p) v Source 
PPVersion v => PrintMaster (VarName p) v Source 
PPVersion v => PrintMaster (SubName p) v Source 

class PrintSlave t v where Source

Slave print behaviour

Methods

printSlave :: (?variant :: v) => t -> String Source

Instances

PPVersion v => PrintSlave String v Source

Behaviours that all slaves must have, i.e., for all versions v

PrintMaster t DefaultPP => PrintSlave t DefaultPP Source

Default slave behaviour

class PrintIndSlave t v where Source

Slave print-indenting behaviour

Methods

printIndSlave :: (?variant :: v) => Int -> t -> String Source

class PrintIndMaster t v where Source

Master print-indenting behaviour

Methods

printIndMaster :: (?variant :: v) => Int -> t -> String Source

printMasterInterfaceSpecs :: (?variant :: v, PrintMaster t v) => [t] -> [Char] Source

show_namelist :: (?variant :: v, PrintSlave t v, PrintSlave t1 v) => [(t, [t1])] -> [Char] Source

show_data :: (?variant :: v, PrintSlave t v, PrintSlave t1 v) => (t, t1) -> [Char] Source

showDV :: (Show a, ?variant :: v, PrintSlave (UnaryOp t) v, PrintSlave (BinOp t) v, PrintSlave (Expr t) v, PrintSlave (ArgList t) v, PrintSlave (VarName t) v, PrintMaster t1 v, PPVersion v) => (t1, Expr t, Maybe a) -> [Char] Source

showDU :: (?variant :: v, PrintMaster t v, PrintMaster t1 v) => (t, t1) -> [Char] Source

showElseIf :: (?variant :: v, PrintSlave t v, PrintSlave t1 v) => Int -> (t, t1) -> [Char] Source

showForall :: (?variant :: v, PrintSlave t1 v, PrintSlave t2 v, PrintSlave (Expr t) v) => [([Char], t1, t2, Expr t)] -> [Char] Source

checkPrec :: BinOp p -> BinOp p -> (a -> a) -> a -> a Source

class Indentor t where Source

Methods

indR :: t -> Int -> String Source

Instances

Indentor (p ()) Source 

showNQ :: Show a => a -> String Source

ind :: Int -> [Char] Source

indent :: Int -> Int -> [Char] Source

printList :: [[a]] -> (a1 -> [a]) -> [a1] -> [a] Source

asTuple :: (a -> [Char]) -> [a] -> [Char] Source

asSeq :: (a -> [Char]) -> [a] -> [Char] Source

asList :: (a -> [Char]) -> [a] -> [Char] Source

asSet :: (a -> [Char]) -> [a] -> [Char] Source

asLisp :: (a -> [Char]) -> [a] -> [Char] Source

asPlain :: (a -> [Char]) -> [a] -> [Char] Source

asPlain' :: (a -> [Char]) -> [a] -> [Char] Source

asCases :: Int -> (a -> [Char]) -> [a] -> [Char] Source

asDefs :: [Char] -> (a -> [Char]) -> [a] -> [Char] Source

asParagraphs :: (a -> [Char]) -> [a] -> [Char] Source

optTuple :: (?variant :: v, PPVersion v, PrintSlave (UnaryOp p) v, PrintMaster (Expr p) v) => [Expr p] -> String Source

optTuple xs = ""

showUnits :: (PPVersion v, ?variant :: v, PrintMaster (Fraction p) v) => [(MeasureUnit, Fraction p)] -> String Source

printMasterList :: (PPVersion v, ?variant :: v, PrintMaster a v) => [a] -> String Source

showBounds :: (PPVersion v, ?variant :: v, PrintMaster (Expr p) v) => (Expr p, Expr p) -> String Source

showRanges :: (PPVersion v, ?variant :: v, PrintMaster (Expr p) v) => [(Expr p, Expr p)] -> String Source

showPartRefList :: (PPVersion v, ?variant :: v, PrintSlave (VarName p) v, PrintSlave (UnaryOp p) v, PrintMaster (Expr p) v) => [(VarName p, [Expr p])] -> String Source