[Haskell-cafe] Parent Modules: Common Functions or Re-Exportation?

Sacha Sokoloski sacha404 at gmail.com
Fri May 16 17:13:27 UTC 2014


So as a relatively long term user of haskell at this point, one issue 
which I've never found a simple solution to is the one stated in the 
thread. That is, given modules Foo, Foo.Bar, and Foo.Baz, should Foo 
reexport Bar and Baz, or should Foo provide common functions for Bar and 
Baz?

In the first case, the common functions would have to be provided by 
some third module Foo.Util, which for some reason I find unsatisfying, 
as it means all my my modules have these Util after Util after Util 
module floating aroudn. My natural tendency is follow the second case, 
but then of course when it comes to actually using the code that I've 
written, I no longer have such a nicely exposed interface outside of the 
particular library.

One simply can't eat ones cake and have it too. Maybe this problem is 
just silly, but perhaps others have always been left feeling ambivalent 
across similar lines, and have somehow found a pleasant solution for 
when this particular crossroads is reached?

Cheers,

  - Sacha Sokoloski


More information about the Haskell-Cafe mailing list