Yes, they are in the global scope, and from what I gather: they are just regular functions, created by special syntax.
There are a few obvious solutions (some of which you might have thought yourself :-):
- rename the accessor or the other function, or
- put the data declaration or the other function in another module and import qualified, or
- write a typeclass with a 'name' function and fit the non-accessor function 'name' somehow into that...
I think the best approach is the modular one, but this really depends on what you are doing.
--
Markus Läll
Given a Haskell "record type" :-data Test= Test {name :: String,value :: Int}test = Test {name = "test",value = 1}main :: IO ()main = doputStrLn (name test)Are "name" and "value" in the global name space, as the following gives an error "Multiple declarations of `name'" :-name :: String -> Stringname s = sIs there any way round this ?Many thanks in advance,
Aaron
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe