S.D.Mechveliani writes:
| [...]
| But a large program is likely to have other data structures with
| the same label names. [...]
|
| [...]
| In such case, the compiler may report the ambiguity, and the
| programmer may add the qualifier.
| But in many other situtations, `up x' would be resolved.
Hi.
How about using qualified imports of modules? It's certainly nicer
than extending the label names, and I think it does most of what
you're asking for.
> cat QL1.hs
module QL1 where
data C1 a = C1 {up :: a, low :: a}
> cat QL2.hs
module QL2 where
data C2 a = C2 {up :: a, low :: a}
> cat Test.hs
module Test where
import qualified QL1
import QL2
> hugs Test.hs
[...]
Test> :t up
up :: C2 a -> a
Test> :t (QL1.up . up)
up . up :: C2 (C1 a) -> a
Test> :t (up . QL1.up)
up . up :: C1 (C2 a) -> a
Regards,
Tom