ambiguous record field names which actually aren’t ambigious
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
Am Montag, 28. Mai 2007 17:41 schrieb Wolfgang Jeltsch:
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 } = ()
Oops, the indentation of the declarations of b and x was too small. Both b and x are meant to be defined in module B.
[…]
Best wishes, Wolfgang
participants (1)
-
Wolfgang Jeltsch