From c86bc6bf7704740c357e5a30ce8c2eee114d5b38 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Wed, 3 Oct 2007 13:06:09 +0200 Subject: reintroduced run as an Exec method: this way it is possible to write plugins by defining either run or start darcs-hash:20071003110609-d6583-68205f8664c81ff7e3349ee67d32ffd4f91881b1.gz --- Commands.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Commands.hs b/Commands.hs index 9c6df7a..eaa0db1 100644 --- a/Commands.hs +++ b/Commands.hs @@ -28,7 +28,13 @@ 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 "" start :: e -> (String -> IO ()) -> IO () + start e cb = go + where go = do + run e >>= cb + tenthSeconds 10 >> go data Command = Com Program Args Alias Rate deriving (Show,Read,Eq) -- cgit v1.2.3