<div dir="ltr">I would personally love to see this feature ported to GHC.<br><div></div><div class="gmail_extra"><br></div><div class="gmail_extra">Best regards,<br>Krzysztof<br></div><div class="gmail_extra"><br><div class="gmail_quote">

On Fri, May 30, 2014 at 11:00 AM, John Meacham <span dir="ltr"><<a href="mailto:john@repetae.net" target="_blank">john@repetae.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

JHC has the feature that<br>
<br>
Graphics.UI.GTK.Button can live in any of:<br>
<br>
Graphics/UI/GTK/Button.hs<br>
Graphics/UI/GTK.Button.hs<br>
Graphics/UI.GTK.Button.hs<br>
Graphics.UI.GTK.Button.hs<br>
<br>
It lets you have deep module hiarchies without deep directory<br>
hierarchies and is not terribly surprising as behaviors go.<br>
<br>
     John<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Apr 25, 2014 at 6:17 AM, Simon Marlow <<a href="mailto:marlowsd@gmail.com">marlowsd@gmail.com</a>> wrote:<br>
> I want to propose a simple change to the -i flag for finding source files.<br>
> The problem we often have is that when you're writing code for a library<br>
> that lives deep in the module hierarchy, you end up needing a deep directory<br>
> structure, e.g.<br>
><br>
>  src/<br>
>    Graphics/<br>
>      UI/<br>
>       Gtk/<br>
>         Button.hs<br>
>         Label.hs<br>
>         ...<br>
><br>
> where the top few layers are all empty.  There have been proposals of<br>
> elaborate solutions for this in the past (module grafting etc.), but I want<br>
> to propose something really simple that would avoid this problem with<br>
> minimal additional complexity:<br>
><br>
>   ghc -iGraphics.UI.Gtk=src<br>
><br>
> the meaning of this flag is that when searching for modules, ghc will look<br>
> for the module Graphics.UI.Gtk.Button in src/Button.hs, rather than<br>
> src/Graphics/UI/Gtk/Button.hs.  The source file itself is unchanged: it<br>
> still begins with "module Graphics.UI.Gtk.Button ...".<br>
><br>
> The implementation is only a few lines in the Finder (and probably rather<br>
> more in the manual and testsuite), but I wanted to get a sense of whether<br>
> people thought this would be a good idea, or if there's a better alternative<br>
> before I push it.<br>
><br>
> Pros:<br>
><br>
>   - simple implementation (but Cabal needs mods, see below)<br>
>   - solves the deep directory problem<br>
><br>
> Cons:<br>
><br>
>   - It makes the rules about finding files a bit more complicated.<br>
>     People need to find source files too, not just compilers.<br>
>   - packages that want to be compatible with older compilers can't<br>
>     use it yet.<br>
>   - you can't use '=' in a source directory name (but we could pick<br>
>     a different syntax if necessary)<br>
>   - It won't work for Cabal packages until Cabal is modified to<br>
>     support it (PreProcess and SrcDist and perhaps Haddock are the only<br>
>     places affected, I think)<br>
>   - Hackage will need to reject packages that use this feature without<br>
>     also specifying ghc >= 7.10 and some cabal-version too.<br>
>   - Are there other tools/libraries that will need changes? Leksah?<br>
><br>
> Cheers,<br>
> Simon<br>
> _______________________________________________<br>
> Glasgow-haskell-users mailing list<br>
> <a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
John Meacham - <a href="http://notanumber.net/" target="_blank">http://notanumber.net/</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users" target="_blank">http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br>
</div></div></blockquote></div><br></div></div>