packages feed

cal-layout-0.1.0.0: example/Bookings.hs

module Main where

import CalLayout

data Booking = Booking {
    bCalId :: String
    , bStart :: Int
    , bEnd :: Int
} deriving (Eq)

instance (CalLayout Booking) where
    start = bStart
    end = bEnd

instance (Show Booking) where
    show (Booking id _ _) = show id

initial = Booking "root" minBound maxBound

events = [
    Booking   "Gym Tour"                     (10*60) (10*60 + 15)
    , Booking "P&P Leg Training"             (10*60) (11*60)
    , Booking "12 days of Christmas workout" (12*60) (14*60)
    , Booking "12 days of Christmas workout" (17*60) (19*60)
    , Booking "12 days of Christmas workout" (14*60) (20*60)
    ]

main :: IO ()
main = mapM_ print $ getDimensions events initial