mmzk-env-0.1.0.0: Read environment variables into a user-defined data type
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Env

Description

This module provides functionality to validate environment variables against a schema (a type that implements the EnvSchema class).

Synopsis

Documentation

class (ExtractFields a, RecordParser a) => EnvSchema a where Source #

Type class for validating environment schemas.

Minimal complete definition

Nothing

Methods

validateEnv :: MonadIO m => m (Either String a) Source #

Validate the environment variables against the schema, transforming field names from camelCase to UPPER_SNAKE_CASE.

validateEnvWith :: MonadIO m => (String -> String) -> m (Either String a) Source #

Validate the environment variables against the schema, allowing for a cusutom transformation function to be applied to the field names to match with the environment variable names.