@@ -1,3 +1,6 @@
1+{-# LANGUAGE StandaloneDeriving #-}
3+{-# LANGUAGE RankNTypes #-}
1-- Copyright 2009-2010 Corey O'Connor
4-- Copyright 2009-2010 Corey O'Connor
2-- Display attributes
5-- Display attributes
@@ -69,8 +72,13 @@ data FixedAttr = FixedAttr
70-- | The style and color attributes can either be the terminal defaults. Or be equivalent to the
73-- | The style and color attributes can either be the terminal defaults. Or be equivalent to the
71-- previously applied style. Or be a specific value.
74-- previously applied style. Or be a specific value.
72−data Eq v => MaybeDefault v = Default | KeepCurrent | SetTo !v
75+data MaybeDefault v where
73− deriving ( Eq, Show )
76+ Default :: MaybeDefault v
77+ KeepCurrent :: MaybeDefault v
78+ SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v
80+deriving instance Eq v => Eq (MaybeDefault v)
81+deriving instance Eq v => Show (MaybeDefault v)
75instance Eq v => Monoid ( MaybeDefault v ) where
83instance Eq v => Monoid ( MaybeDefault v ) where
76 mempty = KeepCurrent
84 mempty = KeepCurrent