new qualified operators

Christian Maeder Christian.Maeder at dfki.de
Thu Jul 15 08:46:57 EDT 2010


Hi,

seeing
http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/syntax-extns.html#new-qualified-operators

Could you add:

  "Spaces are not allowed in new qualified operators!"

For

{-# LANGUAGE NewQualifiedOperators #-}

f1 = (+)
f2 = ( +)
f3 = (+ )
f4 = Prelude.(+)
f5 = Prelude.( +)
f6 = Prelude.(+ )

f1 - f4 are ok, but f5 and f6 are rejected by ghc-6.12.3 with:

  Not in scope: data constructor `Prelude'

So ghc seems to see a composition and:

data T = T (Int -> Int)

f = T.( +)

goes through, whereas

f = T.(+)

reports:

  Not in scope: `T.+'

Note the old qualifiation in the error message.

Christian


More information about the Glasgow-haskell-users mailing list