use Data.Default wherever possible, and deprecate the things it replaces

This commit is contained in:
Daniel Wagner
2013-05-28 01:39:09 +00:00
parent daa2731d3d
commit 0f1b6fb772
55 changed files with 362 additions and 320 deletions

View File

@@ -22,6 +22,7 @@ module XMonad.Actions.TopicSpace
Topic
, Dir
, TopicConfig(..)
, def
, defaultTopicConfig
, getLastFocusedTopics
, setLastFocusedTopic
@@ -89,7 +90,7 @@ import qualified XMonad.Util.ExtensibleState as XS
-- > ]
-- >
-- > myTopicConfig :: TopicConfig
-- > myTopicConfig = defaultTopicConfig
-- > myTopicConfig = def
-- > { topicDirs = M.fromList $
-- > [ ("conf", "w/conf")
-- > , ("dashboard", "Desktop")
@@ -206,14 +207,18 @@ data TopicConfig = TopicConfig { topicDirs :: M.Map Topic Dir
-- numeric keypad.
}
defaultTopicConfig :: TopicConfig
defaultTopicConfig = TopicConfig { topicDirs = M.empty
instance Default TopicConfig where
def = TopicConfig { topicDirs = M.empty
, topicActions = M.empty
, defaultTopicAction = const (ask >>= spawn . terminal . config)
, defaultTopic = "1"
, maxTopicHistory = 10
}
{-# DEPRECATED defaultTopicConfig "Use def (from Data.Default, and re-exported by XMonad.Actions.TopicSpace) instead." #-}
defaultTopicConfig :: TopicConfig
defaultTopicConfig = def
newtype PrevTopics = PrevTopics { getPrevTopics :: [String] } deriving (Read,Show,Typeable)
instance ExtensionClass PrevTopics where
initialValue = PrevTopics []