{-# LANGUAGE DeriveGeneric #-}
module Distribution.Verbosity (
Verbosity,
silent, normal, verbose, deafening,
moreVerbose, lessVerbose, isVerboseQuiet,
intToVerbosity, flagToVerbosity,
showForCabal, showForGHC,
verboseNoFlags, verboseHasFlags,
modifyVerbosity,
verboseCallSite, verboseCallStack,
isVerboseCallSite, isVerboseCallStack,
verboseMarkOutput, isVerboseMarkOutput,
verboseUnmarkOutput,
verboseNoWrap, isVerboseNoWrap,
verboseTimestamp, isVerboseTimestamp,
verboseNoTimestamp,
) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.ReadE
import Data.List (elemIndex)
import Data.Set (Set)
import Distribution.Parsec
import Distribution.Verbosity.Internal
import qualified Data.Set as Set
import qualified Distribution.Compat.CharParsing as P
data Verbosity = Verbosity {
Verbosity -> VerbosityLevel
vLevel :: VerbosityLevel,
Verbosity -> Set VerbosityFlag
vFlags :: Set VerbosityFlag,
Verbosity -> Bool
vQuiet :: Bool
} deriving ((forall x. Verbosity -> Rep Verbosity x)
-> (forall x. Rep Verbosity x -> Verbosity) -> Generic Verbosity
forall x. Rep Verbosity x -> Verbosity
forall x. Verbosity -> Rep Verbosity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Verbosity x -> Verbosity
$cfrom :: forall x. Verbosity -> Rep Verbosity x
Generic, Int -> Verbosity -> ShowS
[Verbosity] -> ShowS
Verbosity -> String
(Int -> Verbosity -> ShowS)
-> (Verbosity -> String)
-> ([Verbosity] -> ShowS)
-> Show Verbosity
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Verbosity] -> ShowS
$cshowList :: [Verbosity] -> ShowS
show :: Verbosity -> String
$cshow :: Verbosity -> String
showsPrec :: Int -> Verbosity -> ShowS
$cshowsPrec :: Int -> Verbosity -> ShowS
Show, ReadPrec [Verbosity]
ReadPrec Verbosity
Int -> ReadS Verbosity
ReadS [Verbosity]
(Int -> ReadS Verbosity)
-> ReadS [Verbosity]
-> ReadPrec Verbosity
-> ReadPrec [Verbosity]
-> Read Verbosity
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Verbosity]
$creadListPrec :: ReadPrec [Verbosity]
readPrec :: ReadPrec Verbosity
$creadPrec :: ReadPrec Verbosity
readList :: ReadS [Verbosity]
$creadList :: ReadS [Verbosity]
readsPrec :: Int -> ReadS Verbosity
$creadsPrec :: Int -> ReadS Verbosity
Read)
mkVerbosity :: VerbosityLevel -> Verbosity
mkVerbosity :: VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
l = Verbosity :: VerbosityLevel -> Set VerbosityFlag -> Bool -> Verbosity
Verbosity { vLevel :: VerbosityLevel
vLevel = VerbosityLevel
l, vFlags :: Set VerbosityFlag
vFlags = Set VerbosityFlag
forall a. Set a
Set.empty, vQuiet :: Bool
vQuiet = Bool
False }
instance Eq Verbosity where
Verbosity
x == :: Verbosity -> Verbosity -> Bool
== Verbosity
y = Verbosity -> VerbosityLevel
vLevel Verbosity
x VerbosityLevel -> VerbosityLevel -> Bool
forall a. Eq a => a -> a -> Bool
== Verbosity -> VerbosityLevel
vLevel Verbosity
y
instance Ord Verbosity where
compare :: Verbosity -> Verbosity -> Ordering
compare Verbosity
x Verbosity
y = VerbosityLevel -> VerbosityLevel -> Ordering
forall a. Ord a => a -> a -> Ordering
compare (Verbosity -> VerbosityLevel
vLevel Verbosity
x) (Verbosity -> VerbosityLevel
vLevel Verbosity
y)
instance Enum Verbosity where
toEnum :: Int -> Verbosity
toEnum = VerbosityLevel -> Verbosity
mkVerbosity (VerbosityLevel -> Verbosity)
-> (Int -> VerbosityLevel) -> Int -> Verbosity
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> VerbosityLevel
forall a. Enum a => Int -> a
toEnum
fromEnum :: Verbosity -> Int
fromEnum = VerbosityLevel -> Int
forall a. Enum a => a -> Int
fromEnum (VerbosityLevel -> Int)
-> (Verbosity -> VerbosityLevel) -> Verbosity -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Verbosity -> VerbosityLevel
vLevel
instance Bounded Verbosity where
minBound :: Verbosity
minBound = VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
forall a. Bounded a => a
minBound
maxBound :: Verbosity
maxBound = VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
forall a. Bounded a => a
maxBound
instance Binary Verbosity
silent :: Verbosity
silent :: Verbosity
silent = VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
Silent
normal :: Verbosity
normal :: Verbosity
normal = VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
Normal
verbose :: Verbosity
verbose :: Verbosity
verbose = VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
Verbose
deafening :: Verbosity
deafening :: Verbosity
deafening = VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
Deafening
moreVerbose :: Verbosity -> Verbosity
moreVerbose :: Verbosity -> Verbosity
moreVerbose Verbosity
v =
case Verbosity -> VerbosityLevel
vLevel Verbosity
v of
VerbosityLevel
Silent -> Verbosity
v
VerbosityLevel
Normal -> Verbosity
v { vLevel :: VerbosityLevel
vLevel = VerbosityLevel
Verbose }
VerbosityLevel
Verbose -> Verbosity
v { vLevel :: VerbosityLevel
vLevel = VerbosityLevel
Deafening }
VerbosityLevel
Deafening -> Verbosity
v
lessVerbose :: Verbosity -> Verbosity
lessVerbose :: Verbosity -> Verbosity
lessVerbose Verbosity
v =
Verbosity -> Verbosity
verboseQuiet (Verbosity -> Verbosity) -> Verbosity -> Verbosity
forall a b. (a -> b) -> a -> b
$
case Verbosity -> VerbosityLevel
vLevel Verbosity
v of
VerbosityLevel
Deafening -> Verbosity
v
VerbosityLevel
Verbose -> Verbosity
v { vLevel :: VerbosityLevel
vLevel = VerbosityLevel
Normal }
VerbosityLevel
Normal -> Verbosity
v { vLevel :: VerbosityLevel
vLevel = VerbosityLevel
Silent }
VerbosityLevel
Silent -> Verbosity
v
modifyVerbosity :: (Verbosity -> Verbosity) -> Verbosity -> Verbosity
modifyVerbosity :: (Verbosity -> Verbosity) -> Verbosity -> Verbosity
modifyVerbosity Verbosity -> Verbosity
f Verbosity
v = Verbosity
v { vLevel :: VerbosityLevel
vLevel = Verbosity -> VerbosityLevel
vLevel (Verbosity -> Verbosity
f Verbosity
v) }
intToVerbosity :: Int -> Maybe Verbosity
intToVerbosity :: Int -> Maybe Verbosity
intToVerbosity Int
0 = Verbosity -> Maybe Verbosity
forall a. a -> Maybe a
Just (VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
Silent)
intToVerbosity Int
1 = Verbosity -> Maybe Verbosity
forall a. a -> Maybe a
Just (VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
Normal)
intToVerbosity Int
2 = Verbosity -> Maybe Verbosity
forall a. a -> Maybe a
Just (VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
Verbose)
intToVerbosity Int
3 = Verbosity -> Maybe Verbosity
forall a. a -> Maybe a
Just (VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
Deafening)
intToVerbosity Int
_ = Maybe Verbosity
forall a. Maybe a
Nothing
parsecVerbosity :: CabalParsing m => m (Either Int Verbosity)
parsecVerbosity :: m (Either Int Verbosity)
parsecVerbosity = m (Either Int Verbosity)
forall b. m (Either Int b)
parseIntVerbosity m (Either Int Verbosity)
-> m (Either Int Verbosity) -> m (Either Int Verbosity)
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> m (Either Int Verbosity)
forall a. m (Either a Verbosity)
parseStringVerbosity
where
parseIntVerbosity :: m (Either Int b)
parseIntVerbosity = (Int -> Either Int b) -> m Int -> m (Either Int b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Either Int b
forall a b. a -> Either a b
Left m Int
forall (m :: * -> *) a. (CharParsing m, Integral a) => m a
P.integral
parseStringVerbosity :: m (Either a Verbosity)
parseStringVerbosity = (Verbosity -> Either a Verbosity)
-> m Verbosity -> m (Either a Verbosity)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Verbosity -> Either a Verbosity
forall a b. b -> Either a b
Right (m Verbosity -> m (Either a Verbosity))
-> m Verbosity -> m (Either a Verbosity)
forall a b. (a -> b) -> a -> b
$ do
VerbosityLevel
level <- m VerbosityLevel
parseVerbosityLevel
()
_ <- m ()
forall (m :: * -> *). CharParsing m => m ()
P.spaces
[Verbosity -> Verbosity]
extras <- m (Verbosity -> Verbosity) -> m [Verbosity -> Verbosity]
forall (f :: * -> *) a. Alternative f => f a -> f [a]
many (m (Verbosity -> Verbosity)
parseExtra m (Verbosity -> Verbosity) -> m () -> m (Verbosity -> Verbosity)
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<* m ()
forall (m :: * -> *). CharParsing m => m ()
P.spaces)
Verbosity -> m Verbosity
forall (m :: * -> *) a. Monad m => a -> m a
return (((Verbosity -> Verbosity)
-> (Verbosity -> Verbosity) -> Verbosity -> Verbosity)
-> (Verbosity -> Verbosity)
-> [Verbosity -> Verbosity]
-> Verbosity
-> Verbosity
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (Verbosity -> Verbosity)
-> (Verbosity -> Verbosity) -> Verbosity -> Verbosity
forall b c a. (b -> c) -> (a -> b) -> a -> c
(.) Verbosity -> Verbosity
forall a. a -> a
id [Verbosity -> Verbosity]
extras (VerbosityLevel -> Verbosity
mkVerbosity VerbosityLevel
level))
parseVerbosityLevel :: m VerbosityLevel
parseVerbosityLevel = [m VerbosityLevel] -> m VerbosityLevel
forall (m :: * -> *) a. Alternative m => [m a] -> m a
P.choice
[ String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"silent" m String -> m VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a. Monad m => a -> m a
return VerbosityLevel
Silent
, String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"normal" m String -> m VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a. Monad m => a -> m a
return VerbosityLevel
Normal
, String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"verbose" m String -> m VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a. Monad m => a -> m a
return VerbosityLevel
Verbose
, String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"debug" m String -> m VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a. Monad m => a -> m a
return VerbosityLevel
Deafening
, String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"deafening" m String -> m VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> VerbosityLevel -> m VerbosityLevel
forall (m :: * -> *) a. Monad m => a -> m a
return VerbosityLevel
Deafening
]
parseExtra :: m (Verbosity -> Verbosity)
parseExtra = Char -> m Char
forall (m :: * -> *). CharParsing m => Char -> m Char
P.char Char
'+' m Char -> m (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> [m (Verbosity -> Verbosity)] -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a. Alternative m => [m a] -> m a
P.choice
[ String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"callsite" m String
-> m (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a. Monad m => a -> m a
return Verbosity -> Verbosity
verboseCallSite
, String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"callstack" m String
-> m (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a. Monad m => a -> m a
return Verbosity -> Verbosity
verboseCallStack
, String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"nowrap" m String
-> m (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a. Monad m => a -> m a
return Verbosity -> Verbosity
verboseNoWrap
, String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"markoutput" m String
-> m (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a. Monad m => a -> m a
return Verbosity -> Verbosity
verboseMarkOutput
, String -> m String
forall (m :: * -> *). CharParsing m => String -> m String
P.string String
"timestamp" m String
-> m (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> (Verbosity -> Verbosity) -> m (Verbosity -> Verbosity)
forall (m :: * -> *) a. Monad m => a -> m a
return Verbosity -> Verbosity
verboseTimestamp
]
flagToVerbosity :: ReadE Verbosity
flagToVerbosity :: ReadE Verbosity
flagToVerbosity = ShowS -> ParsecParser Verbosity -> ReadE Verbosity
forall a. ShowS -> ParsecParser a -> ReadE a
parsecToReadE ShowS
forall a. a -> a
id (ParsecParser Verbosity -> ReadE Verbosity)
-> ParsecParser Verbosity -> ReadE Verbosity
forall a b. (a -> b) -> a -> b
$ do
Either Int Verbosity
e <- ParsecParser (Either Int Verbosity)
forall (m :: * -> *). CabalParsing m => m (Either Int Verbosity)
parsecVerbosity
case Either Int Verbosity
e of
Right Verbosity
v -> Verbosity -> ParsecParser Verbosity
forall (m :: * -> *) a. Monad m => a -> m a
return Verbosity
v
Left Int
i -> case Int -> Maybe Verbosity
intToVerbosity Int
i of
Just Verbosity
v -> Verbosity -> ParsecParser Verbosity
forall (m :: * -> *) a. Monad m => a -> m a
return Verbosity
v
Maybe Verbosity
Nothing -> String -> ParsecParser Verbosity
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> ParsecParser Verbosity)
-> String -> ParsecParser Verbosity
forall a b. (a -> b) -> a -> b
$ String
"Bad verbosity: " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show Int
i String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
". Valid values are 0..3"
showForCabal, showForGHC :: Verbosity -> String
showForCabal :: Verbosity -> String
showForCabal Verbosity
v
| Set VerbosityFlag -> Bool
forall a. Set a -> Bool
Set.null (Verbosity -> Set VerbosityFlag
vFlags Verbosity
v)
= String -> (Int -> String) -> Maybe Int -> String
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (ShowS
forall a. HasCallStack => String -> a
error String
"unknown verbosity") Int -> String
forall a. Show a => a -> String
show (Maybe Int -> String) -> Maybe Int -> String
forall a b. (a -> b) -> a -> b
$
Verbosity -> [Verbosity] -> Maybe Int
forall a. Eq a => a -> [a] -> Maybe Int
elemIndex Verbosity
v [Verbosity
silent,Verbosity
normal,Verbosity
verbose,Verbosity
deafening]
| Bool
otherwise
= [String] -> String
unwords ([String] -> String) -> [String] -> String
forall a b. (a -> b) -> a -> b
$ (case Verbosity -> VerbosityLevel
vLevel Verbosity
v of
VerbosityLevel
Silent -> String
"silent"
VerbosityLevel
Normal -> String
"normal"
VerbosityLevel
Verbose -> String
"verbose"
VerbosityLevel
Deafening -> String
"debug")
String -> [String] -> [String]
forall a. a -> [a] -> [a]
: (VerbosityFlag -> [String]) -> [VerbosityFlag] -> [String]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap VerbosityFlag -> [String]
showFlag (Set VerbosityFlag -> [VerbosityFlag]
forall a. Set a -> [a]
Set.toList (Verbosity -> Set VerbosityFlag
vFlags Verbosity
v))
where
showFlag :: VerbosityFlag -> [String]
showFlag VerbosityFlag
VCallSite = [String
"+callsite"]
showFlag VerbosityFlag
VCallStack = [String
"+callstack"]
showFlag VerbosityFlag
VNoWrap = [String
"+nowrap"]
showFlag VerbosityFlag
VMarkOutput = [String
"+markoutput"]
showFlag VerbosityFlag
VTimestamp = [String
"+timestamp"]
showForGHC :: Verbosity -> String
showForGHC Verbosity
v = String -> (Int -> String) -> Maybe Int -> String
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (ShowS
forall a. HasCallStack => String -> a
error String
"unknown verbosity") Int -> String
forall a. Show a => a -> String
show (Maybe Int -> String) -> Maybe Int -> String
forall a b. (a -> b) -> a -> b
$
Verbosity -> [Verbosity] -> Maybe Int
forall a. Eq a => a -> [a] -> Maybe Int
elemIndex Verbosity
v [Verbosity
silent,Verbosity
normal,Verbosity
__,Verbosity
verbose,Verbosity
deafening]
where __ :: Verbosity
__ = Verbosity
silent
verboseCallSite :: Verbosity -> Verbosity
verboseCallSite :: Verbosity -> Verbosity
verboseCallSite = VerbosityFlag -> Verbosity -> Verbosity
verboseFlag VerbosityFlag
VCallSite
verboseCallStack :: Verbosity -> Verbosity
verboseCallStack :: Verbosity -> Verbosity
verboseCallStack = VerbosityFlag -> Verbosity -> Verbosity
verboseFlag VerbosityFlag
VCallStack
verboseMarkOutput :: Verbosity -> Verbosity
verboseMarkOutput :: Verbosity -> Verbosity
verboseMarkOutput = VerbosityFlag -> Verbosity -> Verbosity
verboseFlag VerbosityFlag
VMarkOutput
verboseUnmarkOutput :: Verbosity -> Verbosity
verboseUnmarkOutput :: Verbosity -> Verbosity
verboseUnmarkOutput = VerbosityFlag -> Verbosity -> Verbosity
verboseNoFlag VerbosityFlag
VMarkOutput
verboseNoWrap :: Verbosity -> Verbosity
verboseNoWrap :: Verbosity -> Verbosity
verboseNoWrap = VerbosityFlag -> Verbosity -> Verbosity
verboseFlag VerbosityFlag
VNoWrap
verboseQuiet :: Verbosity -> Verbosity
verboseQuiet :: Verbosity -> Verbosity
verboseQuiet Verbosity
v = Verbosity
v { vQuiet :: Bool
vQuiet = Bool
True }
verboseTimestamp :: Verbosity -> Verbosity
verboseTimestamp :: Verbosity -> Verbosity
verboseTimestamp = VerbosityFlag -> Verbosity -> Verbosity
verboseFlag VerbosityFlag
VTimestamp
verboseNoTimestamp :: Verbosity -> Verbosity
verboseNoTimestamp :: Verbosity -> Verbosity
verboseNoTimestamp = VerbosityFlag -> Verbosity -> Verbosity
verboseNoFlag VerbosityFlag
VTimestamp
verboseFlag :: VerbosityFlag -> (Verbosity -> Verbosity)
verboseFlag :: VerbosityFlag -> Verbosity -> Verbosity
verboseFlag VerbosityFlag
flag Verbosity
v = Verbosity
v { vFlags :: Set VerbosityFlag
vFlags = VerbosityFlag -> Set VerbosityFlag -> Set VerbosityFlag
forall a. Ord a => a -> Set a -> Set a
Set.insert VerbosityFlag
flag (Verbosity -> Set VerbosityFlag
vFlags Verbosity
v) }
verboseNoFlag :: VerbosityFlag -> (Verbosity -> Verbosity)
verboseNoFlag :: VerbosityFlag -> Verbosity -> Verbosity
verboseNoFlag VerbosityFlag
flag Verbosity
v = Verbosity
v { vFlags :: Set VerbosityFlag
vFlags = VerbosityFlag -> Set VerbosityFlag -> Set VerbosityFlag
forall a. Ord a => a -> Set a -> Set a
Set.delete VerbosityFlag
flag (Verbosity -> Set VerbosityFlag
vFlags Verbosity
v) }
verboseNoFlags :: Verbosity -> Verbosity
verboseNoFlags :: Verbosity -> Verbosity
verboseNoFlags Verbosity
v = Verbosity
v { vFlags :: Set VerbosityFlag
vFlags = Set VerbosityFlag
forall a. Set a
Set.empty }
verboseHasFlags :: Verbosity -> Bool
verboseHasFlags :: Verbosity -> Bool
verboseHasFlags = Bool -> Bool
not (Bool -> Bool) -> (Verbosity -> Bool) -> Verbosity -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Set VerbosityFlag -> Bool
forall a. Set a -> Bool
Set.null (Set VerbosityFlag -> Bool)
-> (Verbosity -> Set VerbosityFlag) -> Verbosity -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Verbosity -> Set VerbosityFlag
vFlags
isVerboseCallSite :: Verbosity -> Bool
isVerboseCallSite :: Verbosity -> Bool
isVerboseCallSite = VerbosityFlag -> Verbosity -> Bool
isVerboseFlag VerbosityFlag
VCallSite
isVerboseCallStack :: Verbosity -> Bool
isVerboseCallStack :: Verbosity -> Bool
isVerboseCallStack = VerbosityFlag -> Verbosity -> Bool
isVerboseFlag VerbosityFlag
VCallStack
isVerboseMarkOutput :: Verbosity -> Bool
isVerboseMarkOutput :: Verbosity -> Bool
isVerboseMarkOutput = VerbosityFlag -> Verbosity -> Bool
isVerboseFlag VerbosityFlag
VMarkOutput
isVerboseNoWrap :: Verbosity -> Bool
isVerboseNoWrap :: Verbosity -> Bool
isVerboseNoWrap = VerbosityFlag -> Verbosity -> Bool
isVerboseFlag VerbosityFlag
VNoWrap
isVerboseQuiet :: Verbosity -> Bool
isVerboseQuiet :: Verbosity -> Bool
isVerboseQuiet = Verbosity -> Bool
vQuiet
isVerboseTimestamp :: Verbosity -> Bool
isVerboseTimestamp :: Verbosity -> Bool
isVerboseTimestamp = VerbosityFlag -> Verbosity -> Bool
isVerboseFlag VerbosityFlag
VTimestamp
isVerboseFlag :: VerbosityFlag -> Verbosity -> Bool
isVerboseFlag :: VerbosityFlag -> Verbosity -> Bool
isVerboseFlag VerbosityFlag
flag = (VerbosityFlag -> Set VerbosityFlag -> Bool
forall a. Ord a => a -> Set a -> Bool
Set.member VerbosityFlag
flag) (Set VerbosityFlag -> Bool)
-> (Verbosity -> Set VerbosityFlag) -> Verbosity -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Verbosity -> Set VerbosityFlag
vFlags