mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
X.U.ExtensibleState: style
This commit is contained in:
parent
0efee8b0cb
commit
a3fb5f5df1
@ -21,7 +21,6 @@ module XMonad.Util.ExtensibleState (
|
|||||||
, getState
|
, getState
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Applicative
|
|
||||||
import Data.Typeable (typeOf,Typeable,cast)
|
import Data.Typeable (typeOf,Typeable,cast)
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import XMonad.Core
|
import XMonad.Core
|
||||||
@ -77,7 +76,7 @@ modifyStateExts f = modify $ \st -> st { extensibleState = f (extensibleState st
|
|||||||
-- | Apply a function to a stored value of the matching type or the initial value if there
|
-- | Apply a function to a stored value of the matching type or the initial value if there
|
||||||
-- is none.
|
-- is none.
|
||||||
modifyState :: ExtensionClass a => (a -> a) -> X ()
|
modifyState :: ExtensionClass a => (a -> a) -> X ()
|
||||||
modifyState f = putState =<< f <$> getState
|
modifyState f = putState . f =<< getState
|
||||||
|
|
||||||
-- | Add a value to the extensible state field. A previously stored value with the same
|
-- | Add a value to the extensible state field. A previously stored value with the same
|
||||||
-- type will be overwritten. (More precisely: A value whose string representation of its type
|
-- type will be overwritten. (More precisely: A value whose string representation of its type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user