llvm-general-pure-3.5.1.0: Pure Haskell LLVM functionality (no FFI).

Safe HaskellNone
LanguageHaskell98

LLVM.General.PrettyPrint

Description

Tools for printing out AST.Module code so that it's actually useful.

Synopsis

Documentation

class Show a => PrettyShow a where Source

a class for simple pretty-printing with indentation a function only of syntactic depth.

Minimal complete definition

Nothing

Methods

prettyShow :: a -> QTree Source

prettyShowList :: [a] -> QTree Source

showPretty :: PrettyShow a => a -> String Source

Show an AST.Module or part thereof both with qualified identifiers (resolving some ambiguity, making the output usable Haskell) and with indentation (making the output readable).

showPrettyEx Source

Arguments

:: PrettyShow a 
=> Int

line length before attempting breaking

-> String

one unit of indentation

-> PrefixScheme

prefixes to use for qualifying names

-> a 
-> String 

Like showPretty but allowing configuration of the format

newtype PrefixScheme Source

A PrefixScheme is a mapping between haskell module names and the prefixes with which they should be rendered when printing code.

Constructors

PrefixScheme (Map String (Maybe String)) 

shortPrefixScheme :: PrefixScheme Source

a terse PrefixScheme, leaving most names unqualified.

longPrefixScheme :: PrefixScheme Source

a conservative PrefixScheme which qualifies everything.

basePrefixScheme :: PrefixScheme Source

a PrefixScheme for types not of llvm-general, but nevertheless used in the AST. Useful for building other PrefixSchemes.

shortASTPrefixScheme :: PrefixScheme Source

a terse PrefixScheme for types in the AST, leaving most names unqualified. Useful for building other PrefixSchemes. If you think you want to use this, you probably want shortPrefixScheme instead.

longASTPrefixScheme :: PrefixScheme Source

a conservative PrefixScheme for types in the AST which qualifies everything. Useful for building other PrefixSchemes. If you think you want to use this, you probably want longPrefixScheme instead.

imports :: PrefixScheme -> String Source

print Haskell imports to define the correct prefixes for use with the output of a given PrefixScheme.