| Copyright | (c) 2015-2016 Peter Trško |
|---|---|
| License | BSD3 |
| Maintainer | peter.trsko@gmail.com |
| Stability | experimental |
| Portability | BangPatterns (optional), CPP, DeriveDataTypeable (optional), DeriveGeneric (optional), NoImplicitPrelude, TemplateHaskell (optional) |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.Verbosity
Description
Simple enum that encodes application Verbosity.
Documentation
Ordering:
Silent<Normal<Verbose<Annoying
Bounds:
minBound=Silent;maxBound=Annoying
Enum:
mapfromEnum[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. |
Instances
| Bounded Verbosity Source # | |
| Enum Verbosity Source # | |
| Eq Verbosity Source # | |
| Data Verbosity Source # | |
| Ord Verbosity Source # | |
| Read Verbosity Source # | |
| Show Verbosity Source # | |
| Generic Verbosity Source # | |
| Binary Verbosity Source # | Encoded as one byte in range |
| Default Verbosity Source # |
|
| NFData Verbosity Source # | |
| HasVerbosity Verbosity Source # | |
| type Rep Verbosity Source # | |
increment' :: Verbosity -> Verbosity Source #
Variant of increment that doesn't fail when maxBound is reached. It
is defined as:
increment'v =fromMaybev (incrementv)
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