| Copyright | (c) Abhinav Gupta 2015 |
|---|---|
| License | BSD3 |
| Maintainer | Abhinav Gupta <mail@abhinavg.net> |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Language.Thrift.Pretty.ANSI
Contents
Description
This module is the same as Language.Thrift.Pretty but the pretty printer used is the one provided by ansi-wl-pprint.
The specifics of the printer can be configured using Config objects.
As with Language.Thrift.Pretty, this module exports instances of the
Pretty typeclass for ansi-wl-pprint.
- prettyPrint :: Program ann -> Doc
- program :: Config -> Program ann -> Doc
- header :: Header ann -> Doc
- include :: Include ann -> Doc
- namespace :: Namespace ann -> Doc
- definition :: Config -> Definition ann -> Doc
- constant :: Config -> Const ann -> Doc
- typeDefinition :: Config -> Type ann -> Doc
- service :: Config -> Service ann -> Doc
- typedef :: Config -> Typedef ann -> Doc
- enum :: Config -> Enum ann -> Doc
- struct :: Config -> Struct ann -> Doc
- union :: Config -> Union ann -> Doc
- exception :: Config -> Exception ann -> Doc
- senum :: Config -> Senum ann -> Doc
- typeReference :: Config -> TypeReference ann -> Doc
- constantValue :: Config -> ConstValue ann -> Doc
- data Config = Config {
- indentWidth :: Int
- defaultConfig :: Config
Documentation
prettyPrint :: Program ann -> Doc Source
Top-level pretty printer for Thrift documents that uses the default
configuration (defaultConfig) for pretty printing.
Components
definition :: Config -> Definition ann -> Doc Source
Print a constant, type, or service definition.
typeDefinition :: Config -> Type ann -> Doc Source
typeReference :: Config -> TypeReference ann -> Doc Source
Pretty print a field type.
constantValue :: Config -> ConstValue ann -> Doc Source
Pretty print a constant value.
Configuration
Configuration for the pretty printer.
Constructors
| Config | |
Fields
| |
defaultConfig :: Config Source
Default pretty printing configuration.