rio-0.1.22.0: A standard library for Haskell

Safe Haskell | Safe-Inferred
Language | Haskell2010

RIO.Prelude.Simple

Description

Provide a ``SimpleApp`` datatype, for providing a basic `App`-like environment with common functionality built in. This is intended to make it easier to, e.g., use rio's logging and process code from within short scripts.

Since: 0.1.3.0

Synopsis

- data SimpleApp
- mkSimpleApp :: MonadIO m => LogFunc -> Maybe ProcessContext -> m SimpleApp
- runSimpleApp :: MonadIO m => RIO SimpleApp a -> m a

# Documentation

data SimpleApp #

A simple, non-customizable environment type for `RIO`, which provides common functionality. If it's insufficient for your needs, define your own, custom `App` data type.

Since: 0.1.3.0

#### Instances

Instances details

HasLogFunc SimpleApp # |
Instance details Defined in RIO.Prelude.Simple Methods logFuncL :: Lens' SimpleApp LogFunc #
HasProcessContext SimpleApp # |
Instance details Defined in RIO.Prelude.Simple Methods processContextL :: Lens' SimpleApp ProcessContext #

mkSimpleApp :: MonadIO m => LogFunc -> Maybe ProcessContext -> m SimpleApp #

Constructor for `SimpleApp`. In case when `ProcessContext` is not supplied `mkDefaultProcessContext` will be used to create it.

Since: 0.1.14.0

runSimpleApp :: MonadIO m => RIO SimpleApp a -> m a #

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

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

Since: 0.1.3.0