[Haskell-cafe] Overloading

Donn Cave donn at avvanta.com
Sun Mar 10 22:06:47 CET 2013


Peter Caspers <pcaspers1973 at gmail.com>,

>> data Month = January | ...
> 
> ok, I will try to change my code in that direction. The idea is clear.

To whatever extent these "algebraic" data types do map to integer
values for your purposes, you can implement that by making Month an
instance of Enum.

	Donn



More information about the Haskell-Cafe mailing list