envparse-0.5.0: Parse environment variables
Safe HaskellSafe-Inferred
LanguageHaskell2010

Env.Internal.Error

Description

This module contains an extensible error infrastructure.

Each kind of errors gets a separate type class which encodes a Prism (roughly a getter and a constructor). The Readers, then, have the constraints for precisely the set of errors they can return.

Synopsis

Documentation

data Error Source #

The type of errors returned by envparse's Readers. These fall into 3 categories:

  • Variables that are unset in the environment.
  • Variables whose value is empty.
  • Variables whose value cannot be parsed.

Instances

Instances details
Eq Error Source # 
Instance details

Defined in Env.Internal.Error

Methods

(==) :: Error -> Error -> Bool #

(/=) :: Error -> Error -> Bool #

Show Error Source # 
Instance details

Defined in Env.Internal.Error

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

AsUnread Error Source # 
Instance details

Defined in Env.Internal.Error

AsEmpty Error Source # 
Instance details

Defined in Env.Internal.Error

AsUnset Error Source # 
Instance details

Defined in Env.Internal.Error

class AsUnset e where Source #

The class of types that contain and can be constructed from the error returned from parsing unset variables.

Methods

unset :: e Source #

tryUnset :: e -> Maybe () Source #

Instances

Instances details
AsUnset Error Source # 
Instance details

Defined in Env.Internal.Error

class AsEmpty e where Source #

The class of types that contain and can be constructed from the error returned from parsing variables whose value is empty.

Methods

empty :: e Source #

tryEmpty :: e -> Maybe () Source #

Instances

Instances details
AsEmpty Error Source # 
Instance details

Defined in Env.Internal.Error

class AsUnread e where Source #

The class of types that contain and can be constructed from the error returned from parsing variable whose value cannot be parsed.

Instances

Instances details
AsUnread Error Source # 
Instance details

Defined in Env.Internal.Error