aboutsummaryrefslogtreecommitdiff
path: root/Utility/Scheduled.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-08 11:48:28 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-08 11:48:28 -0400
commit7ea377dadf61a4acf8ecdfec39954e7b4344c65f (patch)
treef37feed88774b13c8d503484d5e1417441d84ffb /Utility/Scheduled.hs
parent6abf023cb98a5d3b2f9fb251055270e576570983 (diff)
half way complete cronner thread to run scheduled activities
Diffstat (limited to 'Utility/Scheduled.hs')
-rw-r--r--Utility/Scheduled.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Utility/Scheduled.hs b/Utility/Scheduled.hs
index ee6f831ed..1fc8596f5 100644
--- a/Utility/Scheduled.hs
+++ b/Utility/Scheduled.hs
@@ -29,7 +29,7 @@ import Data.Tuple.Utils
{- Some sort of scheduled event. -}
data Schedule = Schedule Recurrance ScheduledTime Duration
- deriving (Eq, Show, Ord)
+ deriving (Eq, Read, Show, Ord)
data Recurrance
= Daily
@@ -39,7 +39,7 @@ data Recurrance
-- Days, Weeks, or Months of the year evenly divisible by a number.
-- (Divisible Year is years evenly divisible by a number.)
| Divisible Int Recurrance
- deriving (Eq, Show, Ord)
+ deriving (Eq, Read, Show, Ord)
type WeekDay = Int
type MonthDay = Int
@@ -48,20 +48,20 @@ type YearDay = Int
data ScheduledTime
= AnyTime
| SpecificTime Hour Minute
- deriving (Eq, Show, Ord)
+ deriving (Eq, Read, Show, Ord)
type Hour = Int
type Minute = Int
data Duration = MinutesDuration Int
- deriving (Eq, Show, Ord)
+ deriving (Eq, Read, Show, Ord)
{- Next time a Schedule should take effect. The NextTimeWindow is used
- when a Schedule is allowed to start at some point within the window. -}
data NextTime
= NextTimeExactly LocalTime
| NextTimeWindow LocalTime LocalTime
- deriving (Eq, Show)
+ deriving (Eq, Read, Show)
nextTime :: Schedule -> Maybe LocalTime -> IO (Maybe NextTime)
nextTime schedule lasttime = do