From fe41ed561aff6cdaf2c624a5a3f1bccd82458585 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Thu, 15 Nov 2007 14:49:05 +0100 Subject: Now that a cold winter is approaching I added a new feature to Weather: the capacity of reading negative temperature. This feature is generally not needed in Summertime. darcs-hash:20071115134905-d6583-a785fbbf0fa9aa49fbf0ba4e230e93ce013748ad.gz --- Plugins/Monitors/Weather.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Plugins') diff --git a/Plugins/Monitors/Weather.hs b/Plugins/Monitors/Weather.hs index 38577bc..e166b74 100644 --- a/Plugins/Monitors/Weather.hs +++ b/Plugins/Monitors/Weather.hs @@ -71,9 +71,10 @@ pTime = do y <- getNumbersAsString return (y, m, d ,([h]++[hh]++":"++[mi]++mimi)) pTemp :: Parser (Int, Int) -pTemp = do f <- manyTill (digit <|> char '.') $ char ' ' +pTemp = do let num = digit <|> char '-' <|> char '.' + f <- manyTill num $ char ' ' manyTill anyChar $ char '(' - c <- manyTill digit $ (char ' ' <|> char '.') + c <- manyTill num $ char ' ' skipRestOfLine return $ (floor (read c :: Double), floor (read f :: Double)) -- cgit v1.2.3