Merry Christmas!
Hope everybody is enjoying the Christmas!
I am doing some readings and I found something seems to be interesting.
People sometime will try to represent a quantity-regard-only data structure
(such a order-regadless List) using functions instead of ta concrete data
structure (like the haskell build-in []), any particular reason for this?
For example,
> data Sex = Male | Female
> classA :: Sex -> Int
> classA Male = 100
> classA Female = 200
when I should prefer the above solution instead of using a concrete data
structure
such as [] to represent the classA members?
It seems to be very difficult to change the number of Male or Female if a
concrete data
structure is not used. Is it possible change the number of Male in classA when
represent
classA using function?
Thank you very much!
Best wishes,
Raeck
_________________________________________________________________
It’s the same Hotmail®. If by “same” you mean up to 70% faster.
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad1_122008
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe