[Haskell-beginners] find element of tupels

Henk-Jan van Tuyl hjgtuyl at chello.nl
Fri Dec 18 06:01:53 EST 2009


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)


> legalDate (d,m,y)
>     | m `elem` [Apr,Jun,Sep,Nov] = 0 < d && d < 31
>     | otherwise = 0 < d && d < 32
>


Regards,
Henk-Jan van Tuyl


--
http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
--


More information about the Beginners mailing list