verbosity-0.2.1.0: Simple enum that encodes application verbosity.

Copyright(c) 2015, Peter Trško
LicenseBSD3
Maintainerpeter.trsko@gmail.com
Stabilityexperimental
PortabilityBangPatterns (optional), CPP, NoImplicitPrelude, DeriveDataTypeable (optional), DeriveGeneric (optional)
Safe HaskellSafe
LanguageHaskell2010

Data.Verbosity

Description

Simple enum that encodes application Verbosity.

Synopsis

Documentation

data Verbosity Source

Ordering:

Silent < Normal < Verbose < Annoying

Bounds:

minBound = Silent; maxBound = Annoying

Enum:

map fromEnum [Silent .. Annoying] = [0, 1, 2, 3]

Constructors

Silent

Don't print any messages.

Normal

Print only important messages. (default)

Verbose

Print anything that comes in to mind.

Annoying

Print debugging/tracing information.

fromInt :: Int -> Maybe Verbosity Source

Safe version of toEnum specialized to Verbosity.

parse :: (Eq string, IsString string) => string -> Maybe Verbosity Source

Generic Verbosity parsing function.

Use case-insensitive package to make this function case insensitive:

ghci> import Data.Verbosity as Verbosity
ghci> import qualified Data.CaseInsensitive as CI (mk)
ghci> Verbosity.parse (CI.mk "silent")
Just Silent