
26 Feb
2009
26 Feb
'09
11:26 a.m.
Hi ho,
One more improvement, include also Enum among the derived classes, then you can write
months = cycle [Jan .. Dec]
Oh, and cycle is also exported from the Prelude, so it's not necessary to import Data.List for that (though you will probably want to imoprt it anyway).
Ohh so many little tasty titbits of Haskell - I was trying for ages to get the '..' operator to work. I guess I will start to know where to look for these guys as time goes on. Cheers, Philip