vin / challenge

Python challenge and project euler

challenge / euler / euler019.hs
100644 9 lines (6 sloc) 0.283 kb
1
2
3
4
5
6
7
8
9
import Data.Time.Calendar
import Data.Time.Calendar.WeekDate
 
sundays = filter (\(_,_,dow) -> (dow == 7)) . map toWeekDate
 
firsts = [ fromGregorian year month 1 | year <- [1901..2000],
                                        month <- [1..12]]
main = print $ length $ sundays firsts