Copyright | (c) 2015-2019 Peter Trško |
---|---|
License | BSD3 |
Maintainer | peter.trsko@gmail.com |
Stability | experimental |
Portability | GHC specific language extensions. |
Safe Haskell | None |
Language | Haskell2010 |
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]
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
increment' :: Verbosity -> Verbosity Source #
Variant of increment
that doesn't fail when maxBound
is reached. It
is defined as:
increment'
v =fromMaybe
v (increment
v)
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