-- Module for not persisting XMonad state. To be used with ExtensibleState -- for data types that cannot be persisted. module Internal.NoPersist where import Data.Default (Default, def) import Data.Typeable import XMonad (ExtensionClass(..)) newtype NoPersist a = NoPersist a deriving (Typeable) instance Show (NoPersist a) where show (NoPersist _) = show () instance (Default a) => Read (NoPersist a) where readsPrec i s = map (\(_, s) -> (NoPersist def, s)) (readsPrec i s :: [((), String)]) instance (Default a) => Default (NoPersist a) where def = NoPersist def instance (Default a, Typeable a) => ExtensionClass (NoPersist a) where initialValue = NoPersist def