From d7677476b38b2cf51f1b3fb97f2c2f6aec759cbe Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Thu, 19 Feb 2009 03:24:17 +0100 Subject: Cleanup X.L.Mosaic, without breaking it Ignore-this: d49ed55fe8dc2204256dff9252384745 darcs-hash:20090219022417-1499c-d9cbc89f5035cf3a3b7698bf2b4bfe306ec3b7b5.gz --- XMonad/Layout/Mosaic.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/XMonad/Layout/Mosaic.hs b/XMonad/Layout/Mosaic.hs index eca1978..aec2339 100644 --- a/XMonad/Layout/Mosaic.hs +++ b/XMonad/Layout/Mosaic.hs @@ -142,8 +142,8 @@ shrinkMaster [] = [] shrinkMaster (x:xs) = x/2:xs splits :: Int -> Rectangle -> [Rational] -> [[Rectangle]] -splits num rect sz = splitsL rect $ makeTree $ normalize - $ map abs $ reverse $ take num sz +splits num rect = splitsL rect . makeTree . normalize + . map abs . reverse . take num -- recursively enumerate splits splitsL :: Rectangle -> Tree Rational -> [[Rectangle]] @@ -165,9 +165,8 @@ interleave xs ys | lx > ly = zc xs (extend lx ys) extend :: Int -> [a] -> [a] extend n pat = do - (p,e') <- zip pat $ take m (repeat True) ++ repeat False - let e = if e' then [p] else [] - (e++) $ take d $ repeat p + (p,e) <- zip pat $ replicate m True ++ repeat False + [p | e] ++ replicate d p where (d,m) = n `divMod` length pat normalize :: Fractional a => [a] -> [a] -- cgit v1.2.3