#ifdef DERIVE_DATA_TYPEABLE
#endif
#ifdef DERIVE_GHC_GENERICS
#endif
module Data.Verbosity (Verbosity(..))
where
import Prelude
( Bounded
#ifdef DECLARE_BINARY_INSTANCE
, Enum(fromEnum, toEnum)
, fromIntegral
#else
, Enum
#endif
)
import Data.Eq (Eq)
import Data.Ord (Ord)
import Text.Show (Show)
import Text.Read (Read)
#ifdef DERIVE_DATA_TYPEABLE
import Data.Data (Data, Typeable)
#endif
#ifdef DERIVE_GHC_GENERICS
import GHC.Generics (Generic)
#endif
#ifdef DECLARE_BINARY_INSTANCE
import Control.Applicative ((<$>))
import Data.Function ((.))
import Data.Binary (Binary(get, put), getWord8, putWord8)
#endif
#ifdef DECLARE_DEFAULT_INSTANCE
import Data.Default.Class (Default(def))
#endif
data Verbosity
= Silent
| Normal
| Verbose
| Annoying
deriving
( Bounded
, Enum
, Eq
, Ord
, Read
, Show
#ifdef DERIVE_GHC_GENERICS
, Generic
#endif
#ifdef DERIVE_DATA_TYPEABLE
, Data
, Typeable
#endif
)
#ifdef DECLARE_DEFAULT_INSTANCE
instance Default Verbosity where
def = Normal
#endif
#ifdef DECLARE_BINARY_INSTANCE
instance Binary Verbosity where
get = toEnum . fromIntegral <$> getWord8
put = putWord8 . fromIntegral . fromEnum
#endif