[Haskell-beginners] print all days of calendar

Daniel Fischer daniel.is.fischer at web.de
Mon Dec 21 15:12:48 EST 2009


Am Montag 21 Dezember 2009 20:47:38 schrieb kane96 at gmx.de:
> >
> > Does (==) ring a few bells?
>
> not really...

Prelude> let okay k = k^3 `mod` 13 == 5 in filter okay [1 .. 30]
[7,8,11,20,21,24]

Now, you don't want the numbers between 1 and 30 inclusive whose cube modulo 13 is 5, but 
the dates in a given month.

getMonth :: Month -> Calendar -> Calendar
getMonth month [(1,Jan,y),(2,Jan,y) ... (31,Dec,y)]


More information about the Beginners mailing list