Removal candidates in patterns

Olaf Chitil O.Chitil at
Fri Jan 27 06:59:18 EST 2006

The arguments of  Ian Lynagh, Ganesh Sittampalam, Claus Reinke and Cale 
about restricting k patterns to class Integral, introducing a class 
Natural and the role of class Eq prove my point that k patterns are 
special, different from data constructors or character literals.

They are special, far more complex than most people think, and very easy 
to avoid.

I do understand that probably everybody learning functional programming 
learned k patterns very early on (in other languages such as Miranda 
there is no overloading problem) and hence find it hard to make the 
small change of using explicit equality instead. (And yes, removing 
k-patterns will break a lot of Haskell programs.)

Higher-order functions substantially increase the expressivity of the 
programming language. k-patterns are just an odd decorative element.

I was probably wrong to start my argument with talking about Hat. This 
is just what made me personally look into k, n+k and ~ patterns. The 
general argument is just that every language feature has its costs (for 
tools, for research, for teaching,...) and hence any language feature 
should be truely useful, not just convenient (naturally the distinction 
is not clear cut).


More information about the Haskell-prime mailing list