Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Env
Description
This module provides functionality to validate environment variables against
a schema (a type that implements the EnvSchema
class).
Synopsis
- class (ExtractFields a, RecordParser a) => EnvSchema a where
- validateEnv :: MonadIO m => m (Either String a)
- validateEnvWith :: MonadIO m => (String -> String) -> m (Either String a)
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.