<div dir="ltr">A typeclass with the shared functions as members is an option. YMMV on whether it is cleaner.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 21, 2017 at 1:56 PM Nikita Churaev <<a href="mailto:lamefun.x0r@gmail.com">lamefun.x0r@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Option 1:<br>
<br>
    module App.Component (Foo, Bar, Qux) -- re-exports<br>
    module App.Component.Foo (Foo, make, func1, func2)<br>
    module App.Component.Bar (Bar, make, func1, func2)<br>
    module App.Component.Qux (Qux, make, func1, func2)<br>
<br>
API clients will have to write long import lists:<br>
<br>
    import App.Component<br>
    import qualified App.Component.Foo as Foo<br>
    import qualified App.Component.Bar as Bar<br>
    import qualified App.Component.Qux as Qux<br>
<br>
<br>
Option 2:<br>
<br>
    module App.Component (module Foo, module Bar) -- re-exports<br>
    module App.Component.Foo (Foo, makeFoo, fooFunc1, fooFunc2)<br>
    module App.Component.Bar (Bar, makeBar, barFunc1, barFunc2)<br>
    module App.Component.Qux (Qux, makeQux, quxFunc1, quxFunc2)<br>
<br>
Now you can import easily:<br>
<br>
    import App.Component<br>
<br>
But now you have to prefix your functions, just like in C...<br>
<br>
Is there another, cleaner option?<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>