
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/)