I often find that I use a library with a set of related modules, say:
A.B
A.B.C
A.B.D
I know what I can do
import A.B (f1, f3)
import A.B.C (f7)
But sometimes these functions have common names that I donβt want to pollute in the main namespace.
So, I can do:
import qualified A.B (f1, f3)
import qualified A.B.C (f7)
But then I have to call functions like A.B.C.f7that which is quite long.
I could do:
import qualified A.B as B
import qualified A.B.C as C
This helps a bit, but I still need to remember and indicate if my functions are from B or C.
What I found is that you can do this:
import qualified A.B as B
import qualified A.B.C as B
Unless there is a function in A.Band A.B.Cwith the same name, and you are trying to use it, you will get a compilation error.
So what I basically want to do is:
import qualified A.B (f1, f3) as B
import qualified A.B.C (f7) as B
. (, ), , ?