Linearity Requirement for Patterns

Dylan Thurston dpt@math.harvard.edu
Fri, 16 Mar 2001 23:14:17 -0500


On Sat, Mar 17, 2001 at 03:49:15PM +1300, Brian Boutel wrote:
> "Samuel E. Moelius III" wrote:
> > 
> > What is the reasoning for the requirement that patterns be linear?  Am I
> > correct to say that if non-linear patterns were allowed, it would require
> > equality to be defined for all data types?  Is this the reason, or are there
> > others?
>
> If that were the reason, then to be consistent, there would be no
> literals in patterns, as these are tested using equality.

Only numeric literals actually use the '==' operator, correct?  (As
opposed to built-in equality for data constructors and characters.)

--Dylan Thurston