[Haskell-cafe] Trouble splitting up source into multiple files, when using data abstraction.

David Banas capn.freako at gmail.com
Sun Apr 13 13:42:32 UTC 2014

Hi all,

I’ve defined a typeclass, LogTree, and would like to put each instance definition in its own source file, in order that LogTree.hs not grow to a ridiculous length.
I’m attempting to use data abstraction, in order to future-proof the user interface to this class.
So, for instance, I don’t make all of the data constructors defined in LogTree accessible, via the module export list, but rather force the user to use certain “helper” functions, instead.
However, the individual instance definitions do need access to these data constructors, but they’re in a different source file.

Is this possible? That is, is it possible to provide different export lists to “friendly” vs. “unknown” client code?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140413/5364627a/attachment.html>

More information about the Haskell-Cafe mailing list