how can I refer to a symbol in a module that is imported 'qualified'?
I need to resolve a name clash between two different Haskell modules that want to use the same infix operator (<*>). The Haskell 98 report says that modid.varsym is permitted, but I can't get it to work. In their entirety here are Test.hs: module Test where import qualified Test2 as T three = T.<*> and Test2.hs: module Test2 where (<*>) = 3 But trying to compile results in an error message: Test.hs:6:12: parse error on input `T.<*>' I tried T.(<*>) but that doesn't work either (as indeed the Haskell 98 report says it should not). How can I refer to a symbolic name defined in a module imported by `import qualified`? Norman
Norman Ramsey wrote:
I need to resolve a name clash between two different Haskell modules that want to use the same infix operator (<*>). The Haskell 98 report says that
modid.varsym
is permitted, but I can't get it to work. In their entirety here are Test.hs:
module Test where
import qualified Test2 as T
three = T.<*>
and Test2.hs:
module Test2 where (<*>) = 3
But trying to compile results in an error message:
Test.hs:6:12: parse error on input `T.<*>'
I tried T.(<*>) but that doesn't work either (as indeed the Haskell 98 report says it should not).
How can I refer to a symbolic name defined in a module imported by `import qualified`?
This works: three = (T.<*>) Anton
participants (2)
-
Anton van Straaten -
nr@cs.tufts.edu