please help me
Eric
ykhsz@sina.com
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.
For example:
strToApps "! 10-11 lecture
12-13 lunch at the refec :("
Would yield:
[((10,11),"lecture",True),
((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.
Best Wishes
Leo
===================================================================
新浪免费电子邮箱 (http://mail.sina.com.cn)
新浪分类信息:二手市场走一走,该出手时就出手! (http://classad.sina.com.cn/2shou/)