Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

haskell

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.

like image 695
bbarker Avatar asked Jan 28 '23 10:01

bbarker


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)
like image 155
snak Avatar answered May 12 '23 16:05

snak