From 825356d7ee6887f38f9e9b35a55bbe721c682b40 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Wed, 3 Oct 2007 16:27:00 +0200 Subject: Date: now implemented using rate and run darcs-hash:20071003142700-d6583-92b890f3badd136dacbfccdcb8b68550f3fff3c8.gz --- Plugins/Date.hs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Plugins/Date.hs b/Plugins/Date.hs index 115cb96..02b1cb3 100644 --- a/Plugins/Date.hs +++ b/Plugins/Date.hs @@ -26,13 +26,11 @@ data Date = Date String String Int deriving (Read, Show) instance Exec Date where - start (Date f _ r) cb = date f r cb - alias (Date _ a _) = a + alias (Date _ a _) = a + run (Date f _ _) = date f + rate (Date _ _ r) = r -date :: String -> Int -> (String -> IO ()) -> IO () -date format r cb = do go - where go = do - t <- toCalendarTime =<< getClockTime - cb $ formatCalendarTime defaultTimeLocale format t - tenthSeconds r >> go - \ No newline at end of file +date :: String -> IO String +date format = do + t <- toCalendarTime =<< getClockTime + return $ formatCalendarTime defaultTimeLocale format t -- cgit v1.2.3