blob: a67e64912f2b21fd7673738052c4220e00c16421 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
-- 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
|