
22 Dec
2008
22 Dec
'08
1:55 p.m.
On 22 Dec 2008, at 17:35, Raeck Zhao wrote:
But I just found another 'problem', I just realize that the list does not support the user-defined data type?
Don't worry, it does.
the list is also depending on the Eq function?
No, it doesn't.
data Shape = Square | Triangle | Circle
[Square, Triangle, Circle]
Should work fine.
or
Square == Square
Wouldn't work unless you declare your type "Shape" an instance of class "Eq" - which can be done automatically.