I have a Trait TGroup that requires #*, #identity and #inverse. I want
to construct a TField by composing TGroup with itself. One TGroup will
form the operations #*, #one, and #reciprocal while the other will
form #+, #zero and #negated.

I don't want #identity or #inverse, because these apply to one
operation, and it makes TField's API ambiguous. That's what
TraitExclusion is for.

I had thought I could say

(TGroup @ {#identity->#zero. #* -> #+. #inverse->#negated} + TGroup @
{#identity->#one. #inverse->#reciprocal}) - {#identity. #inverse}

but TraitComposition >> #- says that exclusion binds tighter than +.
So in effect the above composition is the same as

TGroup @ {#identity->#zero. #* -> #+. #inverse->#negated} + (TGroup @
{#identity->#one. #inverse->#reciprocal} - {#identity. #inverse})

In short, to remove the undesirable #identity and #inverse I have to
exclude from both sides of the composition:

TGroup @ {#identity->#zero. #* -> #+. #inverse->#negated} -
{#identity. #inverse} + TGroup @ {#identity->#one.
#inverse->#reciprocal} - {#identity. #inverse}

My question is this: what is the reason for - binding more tightly
than +? Why is it _not_ desirable to have - distribute over +?

frank

Reply via email to