rio-prettyprint-0.1.8.0: Pretty-printing for RIO

Safe Haskell | None
Language | Haskell2010

RIO.PrettyPrint.Simple

Description

This module exports a `SimplePrettyApp` type, for providing a basic environment including pretty printing functionality.

Synopsis

- data SimplePrettyApp
- mkSimplePrettyApp :: MonadIO m => LogFunc -> Maybe ProcessContext -> Bool -> Int -> StylesUpdate -> m SimplePrettyApp
- runSimplePrettyApp :: MonadIO m => Int -> StylesUpdate -> RIO SimplePrettyApp a -> m a

# Documentation

data SimplePrettyApp Source #

A simple, non-customizable environment type, which provides pretty printing functionality.

Since: 0.1.3.0

#### Instances

Instances details

HasLogFunc SimplePrettyApp Source # |
Instance details Defined in RIO.PrettyPrint.Simple Methods logFuncL :: Lens' SimplePrettyApp LogFunc Source #
HasProcessContext SimplePrettyApp Source # |
Instance details Defined in RIO.PrettyPrint.Simple Methods processContextL :: Lens' SimplePrettyApp ProcessContext Source #
HasTerm SimplePrettyApp Source # |
Instance details Defined in RIO.PrettyPrint.Simple Methods useColorL :: Lens' SimplePrettyApp Bool Source # termWidthL :: Lens' SimplePrettyApp Int Source #
HasStylesUpdate SimplePrettyApp Source # |
Instance details Defined in RIO.PrettyPrint.Simple Methods stylesUpdateL :: Lens' SimplePrettyApp StylesUpdate Source #

mkSimplePrettyApp Source #

Arguments

:: MonadIO m |
=> LogFunc |
-> Maybe ProcessContext |
-> Bool | Use color?
-> Int | Terminal width
-> StylesUpdate |
-> m SimplePrettyApp |

Constructor for `SimplePrettyApp`. If `ProcessContext` is not supplied `mkDefaultProcessContext` will be used to create it.

Since: 0.1.3.0

runSimplePrettyApp Source #

Arguments

:: MonadIO m |
=> Int | Terminal width
-> StylesUpdate |
-> RIO SimplePrettyApp a |
-> m a |

Run with a default configured `SimplePrettyApp`, consisting of:

- Logging to `stderr`
- If the `RIO_VERBOSE` environment variable is set, turns on verbose logging
- Default process context
- Logging using color

Since: 0.1.3.0