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

Safe HaskellNone

LLVM.General.PrettyPrint

Description

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

Synopsis

Documentation

showPretty :: PrettyShow a => a -> String

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

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

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

a terse PrefixScheme, leaving most names unqualified.

longPrefixScheme :: PrefixScheme

a conservative PrefixScheme which qualifies everything.

basePrefixScheme :: PrefixScheme

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

shortASTPrefixScheme :: PrefixScheme

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

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

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