new keyword: infixlr?

Esa Pulkkinen esa.pulkkinen at kotiposti.net
Mon Sep 13 15:33:44 EDT 2010


In message <A48D8AD5-C284-4A2E-9B4F-C84608F724FD at cs.uu.nl>,
"S. Doaitse Swierstra" writes:

>Currently Haskell has infix, infixl and infixr operators. I see a use for infi
>xlr as well. This indicates that the implemtation may assume the operator to b
>e associative, and thus has the freedom to "balance" an expression containing 
>several operator occurrences.

How would this compare with the GHC's RULES pragma? I think you might
be able to express associativity with the rewrite rules? For example,
GHC's Control.Category library already specifies associativity for the
Category class in rewrite rules. It's not clear to me whether the
rewrite rules allow the compiler to do this balancing in practice, but
in principle the information content in the corresponding rewrite rule
is the same.
-- 
  Esa Pulkkinen


More information about the Haskell-prime mailing list