From dfa424ab5f3e1947e009e6dc73fd8d3a5f311e60 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Wed, 3 Oct 2007 16:25:49 +0200 Subject: Reintroduced rate with a default implementation (1 second) to be used in the default implementation of start darcs-hash:20071003142549-d6583-7866ef3df79502568920c3d0b839dbb5bdb31fc8.gz --- Commands.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Commands.hs') 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) -- cgit v1.2.3