[Haskell-beginners] Defeating type inference

Philip Scott pscott at foo.me.uk
Thu Feb 26 06:26:23 EST 2009


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


More information about the Beginners mailing list