summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAlexander Polakov <plhk@sdf.org>2013-03-13 20:40:33 +0400
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-03-13 21:11:47 +0100
commit69a251e1e7a1f198b3bf713a28955c676029aa1f (patch)
tree50f2c07288b906edad0e7ffe24b5a527d149bd53
parente437d175774e02c8541ca02c81a4a62c2590b647 (diff)
downloadxmobar-69a251e1e7a1f198b3bf713a28955c676029aa1f.tar.gz
xmobar-69a251e1e7a1f198b3bf713a28955c676029aa1f.tar.bz2
Help type inferencer a bit, kills warning
-rw-r--r--src/Xmobar.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index e61dc43..3cff475 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -243,10 +243,11 @@ updateActions :: XConf -> Rectangle -> [[(Widget, String, Maybe Action)]] ->
IO [(Action, Position, Position)]
updateActions conf (Rectangle _ _ wid _) ~[left,center,right] = do
let (d,fs) = (display &&& fontS) conf
+ strLn :: [(Widget, String, Maybe Action)] -> IO [(Maybe Action, Position, Position)]
strLn = io . mapM getCoords
iconW i = maybe 0 Bitmap.width (lookup i $ iconS conf)
- getCoords (Text s,_,a) = textWidth d fs s >>= \tw -> return (a,0,fi tw)
- getCoords (Icon s,_,a) = return (a,0,fi $ iconW s)
+ getCoords (Text s,_,a) = textWidth d fs s >>= \tw -> return (a, 0, fi tw)
+ getCoords (Icon s,_,a) = return (a, 0, fi $ iconW s)
partCoord off xs = map (\(a, x, x') -> (fromJust a, x, x')) $
filter (\(a, _,_) -> a /= Nothing) $
scanl (\(_,_,x') (a,_,w') -> (a, x', x' + w')) (Nothing, 0, off) xs