[Haskell-beginners] find element of tupels
Daniel Fischer
daniel.is.fischer at web.de
Fri Dec 18 07:03:06 EST 2009
Am Freitag 18 Dezember 2009 12:01:53 schrieb Henk-Jan van Tuyl:
> On Fri, 18 Dec 2009 00:17:56 +0100, Daniel Fischer
>
> <daniel.is.fischer at web.de> wrote:
> > legalDate (d,Feb,y) = 0 < d && d < (if isLeapYear y then 30 else 29)
>
> This should be:
> legalDate (d, Feb, y) = 0 < d && d < (if isLeapYear y then 29 else 28)
No, I test for strict inequality, hence 30 resp. 29.
>
> > legalDate (d,m,y)
> >
> > | m `elem` [Apr,Jun,Sep,Nov] = 0 < d && d < 31
> > | otherwise = 0 < d && d < 32
>
> Regards,
> Henk-Jan van Tuyl
More information about the Beginners
mailing list