[xmonad] darcs patch: Module for automatic placement of floating windows

Quentin Moser quentin.moser at unifr.ch
Thu Apr 9 09:37:46 EDT 2009


On Thu, 9 Apr 2009 11:42:44 +0200
Quentin Moser <quentin.moser at unifr.ch> wrote:

> 
> > instance Monoid (Query (Endo WindowSet)) where
> >   mempty = return $ Endo id
> >   mappend m1 m2 
> >     = do ws <- Query $ lift $ gets windowset
> >          ws' <- m1 >>= ($ ws) . appEndo
> >          ws'' <- m2 >>= ($ ws') . appEndo
> >          Query $ lift $ modify $ \s -> s {windowset = ws''} 
> >          return $ Endo $ const ws''
> 

My example is wrong. I think this version should be correct:

> instance Monoid (Query (Endo WindowSet)) where
>   mempty = return $ Endo id
>   mappend m1 m2 
>     = do endo1 <- m1
>          ws' <- appEndo endo1 <$> getWS
>          setWS ws'
>
>          endo2 <- m1
>          ws'' <- appEndo endo1 <$> getWS
>          setWS ws''
>
>          return $ Endo $ const ws''

The point is for the Query parts and Endo Windowset parts do be
interleaved and manipulate the same windowset.


More information about the xmonad mailing list