[xmonad] MultiToggle + Decorations breaks upgrading to 0.10

Brent Yorgey byorgey at seas.upenn.edu
Mon Sep 24 12:54:55 CEST 2012

On Sat, Sep 22, 2012 at 10:18:15AM -0500, Joseph Garvin wrote:
> I see that it's complaining that k is applied to too few arguments, so
> I looked in the docs for MultiToggle and in their example it looks
> like k takes what looks like a lambda (I'm actually confused by the
> syntax, I've never seen parens around a lambda parameter) as a second
> argument now for some reason:

The argument of a lambda may be an arbitrary pattern, just like in a
function definition.  Patterns other than single variables usually
need to be surrounded by parentheses, since otherwise they will parse
as multiple arguments.  For example,

  foo (Just x) = x

  \(Just x) -> x

>  data MIRROR = MIRROR deriving (Read, Show, Eq, Typeable)
>  instance Transformer MIRROR Window where
>      transform _ x k = k (Mirror x) (\(Mirror x') -> x')

It looks like the second argument to k is a function which removes the
transformation from the layout.  For decoration, it looks like you

  (\(ModifiedLayout _ x') -> x')

In fact, that will work for the vast majority of transformations,
which are mostly implemented using a layout modifier.  Mirror is
special because it's built into the xmonad core.


More information about the xmonad mailing list