diff options
author | Daniel Wagner <daniel@wagner-home.com> | 2013-05-28 03:39:09 +0200 |
---|---|---|
committer | Daniel Wagner <daniel@wagner-home.com> | 2013-05-28 03:39:09 +0200 |
commit | 6769de07f7e06ddf6eea728bd7072ebfe6eff017 (patch) | |
tree | f234bf0cac01538fbc1acab1a668ac61b9ab8074 /XMonad/Actions/GridSelect.hs | |
parent | fe066e8e9ca5326dd146630a6d729fae51af12cf (diff) | |
download | XMonadContrib-6769de07f7e06ddf6eea728bd7072ebfe6eff017.tar.gz XMonadContrib-6769de07f7e06ddf6eea728bd7072ebfe6eff017.tar.xz XMonadContrib-6769de07f7e06ddf6eea728bd7072ebfe6eff017.zip |
use Data.Default wherever possible, and deprecate the things it replaces
Ignore-this: 898458b1d2868a70dfb09faf473dc7aa
darcs-hash:20130528013909-76d51-863278165b6f149c47b08b31b34e85ddcab19f1f.gz
Diffstat (limited to 'XMonad/Actions/GridSelect.hs')
-rw-r--r-- | XMonad/Actions/GridSelect.hs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/XMonad/Actions/GridSelect.hs b/XMonad/Actions/GridSelect.hs index e7ba0b7..1543644 100644 --- a/XMonad/Actions/GridSelect.hs +++ b/XMonad/Actions/GridSelect.hs @@ -27,6 +27,7 @@ module XMonad.Actions.GridSelect ( -- * Configuration GSConfig(..), + def, defaultGSConfig, TwoDPosition, buildDefaultGSConfig, @@ -167,7 +168,7 @@ import Data.Word (Word8) -- -- You can then define @gsconfig3@ which may be used in exactly the same manner as @gsconfig1@: -- --- > gsconfig3 = defaultGSConfig +-- > gsconfig3 = def -- > { gs_cellheight = 30 -- > , gs_cellwidth = 100 -- > , gs_navigate = myNavigation @@ -183,6 +184,11 @@ import Data.Word (Word8) -- -- <<http://haskell.org/wikiupload/3/35/Xmonad-gridselect-window-aavogt.png>> +-- | The 'Default' instance gives a basic configuration for 'gridselect', with +-- the colorizer chosen based on the type. +-- +-- If you want to replace the 'gs_colorizer' field, use 'buildDefaultGSConfig' +-- instead of 'def' to avoid ambiguous type variables. data GSConfig a = GSConfig { gs_cellheight :: Integer, gs_cellwidth :: Integer, @@ -212,12 +218,12 @@ instance HasColorizer a where let getColor = if isFg then focusedBorderColor else normalBorderColor in asks $ flip (,) "black" . getColor . config --- | A basic configuration for 'gridselect', with the colorizer chosen based on the type. --- --- If you want to replace the 'gs_colorizer' field, use 'buildDefaultGSConfig' --- instead, to avoid ambiguous type variables. +instance HasColorizer a => Default (GSConfig a) where + def = buildDefaultGSConfig defaultColorizer + +{-# DEPRECATED defaultGSConfig "Use def (from Data.Default, and re-exported from XMonad.Actions.GridSelect) instead." #-} defaultGSConfig :: HasColorizer a => GSConfig a -defaultGSConfig = buildDefaultGSConfig defaultColorizer +defaultGSConfig = def type TwoDPosition = (Integer, Integer) |