
20 Dec
2009
20 Dec
'09
4:25 p.m.
Am Sonntag 20 Dezember 2009 22:11:51 schrieb kane96@gmx.de:
I implemented the first step which works if I fix the months (instead of the Month Enum) and just return the day and not an element of type Date
this works: calendar year = [ day | month <- [Jan, Feb], day <- [1..31], legalDate(day,month,year) == True ]
this doesn't work: calendar year = [ Date(day,month,year) | month <- Month, day <- [1..31], legalDate(day,month,year) == True ]
Date was a type synonym for the triple, so calendar year = [ (day,month,year) | month <- Month, day <- [1..31], legalDate(day,month,year)] should be what you want. Note, "condition == True" is better written as "condition".