28 May
2007
28 May
'07
3:41 p.m.
Hello, I have the following modules: module A where data A = A { label :: Int } module B where data B = B { label :: Int } b :: B b = B { label = 0 } x :: B -> () x B { label = 0 } = () GHC reports an ambiguity for both usages of label. However, it should be clear that both usages can only refer to B.label since a field name in record syntax can only be one that is defined in the same module as the corresponding record type. Hugs accepts the above code. Is there a way to make GHC accept it too? Best wishes, Wolfgang