Yes, that would prevent the shadowing. But now you are ignoring the
argument op1. Choosing a name that is more different from 'op' might
be helpful. You can even invent your own operator as an argument to
your commutative function:

  commutative (⊕) = \a b -> (a ⊕ b) == (b ⊕ a)

On Mon, Nov 1, 2010 at 11:15 AM, Patrick Browne <patrick.bro...@dit.ie> wrote:
> Does the following avoid the shadowing?
>
> infixl 5 `op`
> op :: Int -> Int -> Int
> x `op` y  = (x + y)
> commutative op1 = \a b ->  (a `op` b) == (b `op` a)
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to