From 15d0e2b383376f047ccc563254a285e58e134340 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Sun, 28 Oct 2007 23:38:37 +0100 Subject: Avoid irrefutable pattern in handling text alignment darcs-hash:20071028223837-d6583-9a70143b0fdd4107959893acab34a481bd7603e4.gz --- Xmobar.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Xmobar.hs') diff --git a/Xmobar.hs b/Xmobar.hs index 2c50db6..f1e084e 100644 --- a/Xmobar.hs +++ b/Xmobar.hs @@ -168,11 +168,12 @@ updateWin v = do then alignSep conf else alignSep defaultConfig i <- io $ atomically $ readTVar v - let [l,c,r] = if (lc `elem` i && rc `elem` i) - then let (le,_:re) = break (==lc) i - (ce,_:ri) = break (==rc) re - in [le,ce,ri] - else [i,[],[]] + let def = [i,[],[]] + [l,c,r] = case break (==lc) i of + (le,_:re) -> case break (==rc) re of + (ce,_:ri) -> [le,ce,ri] + _ -> def + _ -> def ps <- io $ mapM (parseString conf) [l,c,r] drawInWin rec ps -- cgit v1.2.3