language-thrift-0.4.0.0: Parser and pretty printer for the Thrift IDL format.

Copyright(c) Abhinav Gupta 2015
LicenseBSD3
MaintainerAbhinav Gupta <mail@abhinavg.net>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Language.Thrift.Pretty

Contents

Description

This module provides a pretty printer for Thrift IDLs. The pretty printer prserves docstrings specified for types.

The specifics of the printer can be configured using Config objects.

Synopsis

Documentation

prettyPrint :: Program ann -> Doc Source

Top-level pretty printer for Thrift documents that uses the default configuration (defaultConfig) for pretty printing.

Components

program :: Config -> Program ann -> Doc Source

Pretty print a Thrift IDL.

header :: Header -> Doc Source

Print the headers for a program.

definition :: Config -> Definition ann -> Doc Source

Print a constant, type, or service definition.

function :: Config -> Function ann -> Doc Source

Pretty print a function definition.

fieldType :: Config -> FieldType -> Doc Source

Pretty print a field type.

constantValue :: Config -> ConstValue -> Doc Source

Pretty print a constant value.

Configuration

data Config Source

Configuration for the pretty printer.

Constructors

Config 

Fields

indentWidth :: Int

Number of spaces to use for indentation.

Instances

defaultConfig :: Config Source

Default pretty printing configuration.