xmonad-contrib-gpl-0.12.1: Third party extensions for xmonad

Copyright(c) Dmitry Bogatov <KAction@gnu.org>
LicenseGPL3
MaintainerDmitry Bogatov <KAction@gnu.org>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell98
Extensions
  • MonoLocalBinds
  • ScopedTypeVariables
  • TypeFamilies
  • StandaloneDeriving
  • DeriveGeneric
  • DefaultSignatures
  • TypeSynonymInstances
  • FlexibleInstances
  • MultiParamTypeClasses
  • KindSignatures
  • GeneralizedNewtypeDeriving
  • ExplicitNamespaces
  • ExplicitForAll
  • LambdaCase

XMonad.Util.WindowState2

Contents

Description

Functions for saving and retriving arbitary data in windows.

This module have advantage over TagWindows in that it hides from you implementation details and provides simple type-safe interface.

Synopsis

Usage

stateQuery :: Query a -> StateQuery s a Source

Lift Query to StateQuery.

unstate :: StateQuery s a -> Query a Source

runStateQuery :: StateQuery s a -> Window -> X a Source

Same, as "runQuery".

get :: MonadState s m => m s

Return the state from the internals of the monad.

put :: MonadState s m => s -> m ()

Replace the state inside the monad.

modify :: MonadState s m => (s -> s) -> m ()

Monadic state transformer.

Maps an old state to a new state inside a state monad. The old state is thrown away.

     Main> :t modify ((+1) :: Int -> Int)
     modify (...) :: (MonadState Int a) => a ()

This says that modify (+1) acts over any Monad that is a member of the MonadState class, with an Int state.