please help me
Sun, 07 Apr 2002 11:39:39 +0800
Hi there, I am a beginner a haskell,and I have some difficulty in dealing with an assignment that is to translate a string representation of a list of appointments into a list of appointments.
strToApps "! 10-11 lecture
12-13 lunch at the refec :("
((12,13),"lunch at the refec :(",False)]
"!" is used to determine that appointment is important or not
I have done some work,those are:
> type Date = (Day,Month,Year) -- e.g. (1,1,2000) = 1/1/2000
> type Year = Int
> type Month= Int
> type Day = Int
> type Hour = Int
> type Minute = Int
> type Time = Hour -- only times on the hour for now
> type Appointment = (Duration, Note, Important)
> type Duration = (Time,Time) -- e.g. (13,14) = 1-2pm, forall (s,f) in Duration: s < f
> type Note = String
> type Important = Bool
> strToApps :: String -> [Appointment]
> strToApps s =
How can I finish the requirement make use of library functions such as words, unwords, lines and break.
I am eager to receive your help, thank you very much.