In Haskell, is it possible to qualify part of an imported module?

Viewed 86

I'd like to be able to do something like: import qualified Data.Massiv.Array (qualified map).

This gives error: parse error on input `map'.

Or better yet, import qualified Data.Massiv.Array (qualified map) as AM, so I also can access foo as either foo or AM.foo, unless foo == map, then I have to use AM.map. This is to avoid conflict with Prelude.map.

1 Answers

Write two imports and you can use map as AM.map and use other functions without AM..

import qualified Data.Massiv.Array as AM
import Data.Massiv.Array hiding (map)
Related