From 42dee4768e3c7c9d4e02a700b4d6683ee059a383 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Wed, 7 May 2008 01:31:22 +0000 Subject: [PATCH] Comments --- XMonad/Layout.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/XMonad/Layout.hs b/XMonad/Layout.hs index 3d9ce0a..8e5dc95 100644 --- a/XMonad/Layout.hs +++ b/XMonad/Layout.hs @@ -141,14 +141,20 @@ infixr 5 ||| -- | A layout that allows users to switch between various layout options. data Choose l r a = Choose LR (l a) (r a) deriving (Read, Show) +-- | Are we on the left or right sub-layout? data LR = L | R deriving (Read, Show, Eq) data NextNoWrap = NextNoWrap deriving (Eq, Show, Typeable) instance Message NextNoWrap +-- | A small wrapper around handleMessage, as it is tedious to write +-- SomeMessage repeatedly. handle :: (LayoutClass l a, Message m) => l a -> m -> X (Maybe (l a)) handle l m = handleMessage l (SomeMessage m) +-- | A smart constructor that takes some potential modifications, returns a +-- new structure if any fields have changed, and performs any necessary cleanup +-- on newly non-visible layouts. choose :: (LayoutClass l a, LayoutClass r a) => Choose l r a-> LR -> Maybe (l a) -> Maybe (r a) -> X (Maybe (Choose l r a)) choose (Choose d _ _) d' Nothing Nothing | d == d' = return Nothing