[Haskell-beginners] print all days of calendar

kane96 at gmx.de kane96 at gmx.de
Mon Dec 21 15:39:38 EST 2009


-------- Original-Nachricht --------
> Datum: Mon, 21 Dec 2009 21:12:48 +0100
> Von: Daniel Fischer <daniel.is.fischer at web.de>
> An: beginners at haskell.org
> CC: kane96 at gmx.de
> Betreff: Re: [Haskell-beginners] print all days of calendar

> 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 like this:
getMonth month calendar = calendar filter ([1..31], month, year)
but it doesn't make sense


-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


More information about the Beginners mailing list