logo       

Constr and Eq: msg#00164

lang.haskell.glasgow.bugs

Subject: Constr and Eq

> toConstr True
True
> toConstr [()]
(:)
> toConstr True == toConstr [()]
True
> show (toConstr True) == show (toConstr [()])
False

I don't understand the utility of Constr's Eq definition. It isn't
really documented though. Why return True when the constructors being
compared are different? Am I supposed to use (show.toConstr) to
compare constructors?

Here is the documentation I could find:

data Constr
Representation of constructors
Instances
Show Constr
Eq Constr

This is ghc 6.4.1.

Thanks,

Frederik


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise