luochen1990
luochen1990

Reputation: 3847

Haskell re-export module which only import a selected part of identifiers

I know that I can re-export modules like following:

module Test (module Test) where

import Prelude as Test
import A as Test

f x = x

But now I want to do re-export a partial imported module like

module Test (module Test) where

import Prelude (map, filter) as Test
import A as Test

f x = x

References:

Upvotes: 1

Views: 117

Answers (1)

luochen1990
luochen1990

Reputation: 3847

From Haskell wiki about Import, there is an example like this:

import Mod as Foo (x,y)

So, do it like this:

module Test (module Test) where

import Prelude as Test (map, filter)
import A as Test

f x = x

Upvotes: 2

Related Questions