xmonad-0.11: A tiling window manager

Portability
Stabilityprovisional
MaintainerDon Stewart <dons@galois.com>
Safe HaskellNone

XMonad

Description

 

Synopsis

Documentation

(.|.) :: Bits a => a -> a -> a

Bitwise "or"

class Monad m => MonadState s m | m -> s where

Minimal definition is either both of get and put or just state

Methods

get :: m s

Return the state from the internals of the monad.

put :: s -> m ()

Replace the state inside the monad.

state :: (s -> (a, s)) -> m a

Embed a simple state action into the monad.

Instances

MonadState XState X 
(Monad (MaybeT m), MonadState s m) => MonadState s (MaybeT m) 
(Monad (ListT m), MonadState s m) => MonadState s (ListT m) 
(Monad (IdentityT m), MonadState s m) => MonadState s (IdentityT m) 
(Monad (WriterT w m), Monoid w, MonadState s m) => MonadState s (WriterT w m) 
(Monad (WriterT w m), Monoid w, MonadState s m) => MonadState s (WriterT w m) 
(Monad (StateT s m), Monad m) => MonadState s (StateT s m) 
(Monad (StateT s m), Monad m) => MonadState s (StateT s m) 
(Monad (ReaderT r m), MonadState s m) => MonadState s (ReaderT r m) 
(Monad (ErrorT e m), Error e, MonadState s m) => MonadState s (ErrorT e m) 
(Monad (ContT r m), MonadState s m) => MonadState s (ContT r m) 
(Monad (RWST r w s m), Monad m, Monoid w) => MonadState s (RWST r w s m) 
(Monad (RWST r w s m), Monad m, Monoid w) => MonadState s (RWST r w s m) 

gets :: MonadState s m => (s -> a) -> m a

Gets specific component of the state, using a projection function supplied.

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.

class Monad m => MonadReader r m | m -> r where

See examples in Control.Monad.Reader. Note, the partially applied function type (->) r is a simple reader monad. See the instance declaration below.

Methods

ask :: m r

Retrieves the monad environment.

local

Arguments

:: (r -> r)

The function to modify the environment.

-> m a

Reader to run in the modified environment.

-> m a 

Executes a computation in a modified environment.

reader

Arguments

:: (r -> a)

The selector function to apply to the environment.

-> m a 

Retrieves a function of the current environment.

Instances

MonadReader Window Query 
MonadReader XConf X 
(Monad (MaybeT m), MonadReader r m) => MonadReader r (MaybeT m) 
(Monad (ListT m), MonadReader r m) => MonadReader r (ListT m) 
(Monad (IdentityT m), MonadReader r m) => MonadReader r (IdentityT m) 
Monad ((->) r) => MonadReader r ((->) r) 
(Monad (WriterT w m), Monoid w, MonadReader r m) => MonadReader r (WriterT w m) 
(Monad (WriterT w m), Monoid w, MonadReader r m) => MonadReader r (WriterT w m) 
(Monad (StateT s m), MonadReader r m) => MonadReader r (StateT s m) 
(Monad (StateT s m), MonadReader r m) => MonadReader r (StateT s m) 
(Monad (ReaderT r m), Monad m) => MonadReader r (ReaderT r m) 
(Monad (ErrorT e m), Error e, MonadReader r m) => MonadReader r (ErrorT e m) 
(Monad (ContT r m), MonadReader r' m) => MonadReader r' (ContT r m) 
(Monad (RWST r w s m), Monad m, Monoid w) => MonadReader r (RWST r w s m) 
(Monad (RWST r w s m), Monad m, Monoid w) => MonadReader r (RWST r w s m) 

asks

Arguments

:: MonadReader r m 
=> (r -> a)

The selector function to apply to the environment.

-> m a 

Retrieves a function of the current environment.

class Monad m => MonadIO m where

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Methods

liftIO :: IO a -> m a

Lift a computation from the IO monad.

Instances

MonadIO IO 
MonadIO Query 
MonadIO X 
(Monad (ListT m), MonadIO m) => MonadIO (ListT m) 
(Monad (MaybeT m), MonadIO m) => MonadIO (MaybeT m) 
(Monad (IdentityT m), MonadIO m) => MonadIO (IdentityT m) 
(Monad (ContT r m), MonadIO m) => MonadIO (ContT r m) 
(Monad (ErrorT e m), Error e, MonadIO m) => MonadIO (ErrorT e m) 
(Monad (ReaderT r m), MonadIO m) => MonadIO (ReaderT r m) 
(Monad (StateT s m), MonadIO m) => MonadIO (StateT s m) 
(Monad (StateT s m), MonadIO m) => MonadIO (StateT s m) 
(Monad (WriterT w m), Monoid w, MonadIO m) => MonadIO (WriterT w m) 
(Monad (WriterT w m), Monoid w, MonadIO m) => MonadIO (WriterT w m) 
(Monad (RWST r w s m), Monoid w, MonadIO m) => MonadIO (RWST r w s m) 
(Monad (RWST r w s m), Monoid w, MonadIO m) => MonadIO (RWST r w s m)