[Haskell-beginners] print all days of calendar

kane96 at gmx.de kane96 at gmx.de
Mon Dec 21 05:38:14 EST 2009


-------- Original-Nachricht --------
> Datum: Mon, 21 Dec 2009 11:26:04 +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 11:05:03 schrieb kane96 at gmx.de:
> >
> > still have the problem that it says:
> > "Not in scope: data constructor `Month'" but Month is declared as:
> > data Month = Jan | Feb | Mar | Apr | May | Jun | Jul | Ago | Sep | Oct |
> > Nov | Dec deriving (Eq,Enum,Show)
> 
> Sorry, didn't look closely enough.
> Month is the name of the datatype. You want month to run through all
> elements of Month, so 
> you need a list, namely [Jan .. Dec] (it might be necessary to include Ord
> in the derived 
> instances for Month).

ahhh, it works in the right order. I tried [Jan..Dec] (without the spaces) which failed.

Which function can I use to trim the calendar of a month from the calendar of the whole year, because I have to implement a function:
getMonth :: Month -> Calendar -> Calendar

-- 
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