Richard O'Keefe wrote:
 
> The thing is that it really seems bizarre to see this one feature
> singled out for non-implementation. 
> 
> If I can do the equivalent of n+k patterns by programming in the
> *type system*, why *not* in a pattern? 

Do you mean by something like the following?

data Z = Z
data S n = S n

type Plus2 a = S (S a)

minus2 :: Plus2 a -> a
minus2 _ = undefined -- or actually use the values, or whatever

If so, I'd say that n+k patterns go well beyond this kind of "pattern
aliases", particularly since they operate on arbitrary Nums, not just an
inductively defined natural number type.

Cheers,

Ganesh

=============================================================================== 
 Please access the attached hyperlink for an important electronic 
communications disclaimer: 
 http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
 
=============================================================================== 
 
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to