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 Source #

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 Source # |
Instance details Defined in RIO.Prelude.Simple Methods logFuncL :: Lens' SimpleApp LogFunc Source #
HasProcessContext SimpleApp Source # |
Instance details Defined in RIO.Prelude.Simple Methods processContextL :: Lens' SimpleApp ProcessContext Source #

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

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 Source #

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