diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-10-03 16:25:49 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-10-03 16:25:49 +0200 |
commit | dfa424ab5f3e1947e009e6dc73fd8d3a5f311e60 (patch) | |
tree | 8f5868baf186a144d56a2051d37ca01aa223f1bd | |
parent | 8768241ed9f2537fa01028e6e43edb71354f3ef3 (diff) | |
download | xmobar-dfa424ab5f3e1947e009e6dc73fd8d3a5f311e60.tar.gz xmobar-dfa424ab5f3e1947e009e6dc73fd8d3a5f311e60.tar.bz2 |
Reintroduced rate with a default implementation (1 second) to be used in the default implementation of start
darcs-hash:20071003142549-d6583-7866ef3df79502568920c3d0b839dbb5bdb31fc8.gz
-rw-r--r-- | Commands.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Commands.hs b/Commands.hs index eaa0db1..1be0677 100644 --- a/Commands.hs +++ b/Commands.hs @@ -27,14 +27,16 @@ import System.IO (hClose, hGetLine) class Show e => Exec e where alias :: e -> String - alias e = takeWhile (not . isSpace) $ show e - run :: e -> IO String - run _ = return "" + alias e = takeWhile (not . isSpace) $ show e + rate :: e -> Int + rate _ = 10 + run :: e -> IO String + run _ = return "" start :: e -> (String -> IO ()) -> IO () start e cb = go where go = do run e >>= cb - tenthSeconds 10 >> go + tenthSeconds (rate e) >> go data Command = Com Program Args Alias Rate deriving (Show,Read,Eq) |