Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell export current module with additional imported module

Is it possible to write a module in Haskell, which re-exports a module in addition to exporting everything visible inside?

Lets consider following module:

module Test where import A  f x = x 

This module exports everything defined inside, so it exports f but does not re-export anything imported from A.

On the other hand, if I want to re-export the module A:

module Test (     module A,     f ) where import A  f x = x 

Is there a way to re-export A and export everything defined in Test without needing to explicitly write every function defined within Test?

like image 515
Wojciech Danilo Avatar asked Aug 03 '13 17:08

Wojciech Danilo


1 Answers

There is a simple solution, just export the module from the module:

module Test     ( module Test     , module A     ) where  import Prelude() import A f x = x 
like image 69
Thomas M. DuBuisson Avatar answered Oct 08 '22 04:10

Thomas M. DuBuisson