
On 18/12/09 14:57, kane96@gmx.de wrote:
thx Daniel. Now I implemented it like that to use my monthAndMaxDay list and just use the isLeapYear check for February:
legalDate :: Date -> Bool legalDate (myDay, Feb, myYear) = 0 < myDay && myDay <= (if isLeapYear myYear then 29 else 28) legalDate (myDay, myMonth, myYear) = maybe False id $ do days <- lookup myMonth monthAndMaxDay return (not (myDay <= 0) && (myDay <= days))
I know it's a minor detail, but wouldn't it be clearer to change that last line to read something like this: return $ 0 < myDay && myDay <= days ? /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe