| 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 # | |
| Enum Verbosity # | |
Defined in Data.Verbosity Methods succ :: Verbosity -> Verbosity # pred :: Verbosity -> Verbosity # fromEnum :: Verbosity -> Int # enumFrom :: Verbosity -> [Verbosity] # enumFromThen :: Verbosity -> Verbosity -> [Verbosity] # enumFromTo :: Verbosity -> Verbosity -> [Verbosity] # enumFromThenTo :: Verbosity -> Verbosity -> Verbosity -> [Verbosity] # | |
| Eq Verbosity # | |
| Data Verbosity # | |
Defined in Data.Verbosity Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Verbosity -> c Verbosity # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Verbosity # toConstr :: Verbosity -> Constr # dataTypeOf :: Verbosity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Verbosity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Verbosity) # gmapT :: (forall b. Data b => b -> b) -> Verbosity -> Verbosity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Verbosity -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Verbosity -> r # gmapQ :: (forall d. Data d => d -> u) -> Verbosity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Verbosity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Verbosity -> m Verbosity # | |
| Ord Verbosity # | |
| Read Verbosity # | |
| Show Verbosity # | |
| Generic Verbosity # | |
| Binary Verbosity # | Encoded as one byte in range |
| Default Verbosity # |
|
Defined in Data.Verbosity | |
| NFData Verbosity # | |
Defined in Data.Verbosity | |
| HasVerbosity Verbosity # | |
| type Rep Verbosity # | |
Defined in Data.Verbosity type Rep Verbosity = D1 (MetaData "Verbosity" "Data.Verbosity" "verbosity-0.2.3.0-HgAnoWDIosa8mnl1GtvHyo" False) ((C1 (MetaCons "Silent" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Normal" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "Verbose" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Annoying" PrefixI False) (U1 :: * -> *))) | |
increment' :: Verbosity -> Verbosity #
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 #
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