summaryrefslogtreecommitdiffhomepage
path: root/Commands.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Commands.hs')
-rw-r--r--Commands.hs10
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)