Coming from Scala where I can basically structure my directory sources the way I want I got a bit frustrated by Haskell rigidity here.

So definitely a +1, and I agree cabal support is quite important.

OTOH, I don't think Haskell should go in the way of allowing 'any' structure (like scala), but being able to have shortcut like that would be definitely beneficial.

Also, I don't think integrating such feature will be an issue for the text editors "jump to declaration" feature, as they should usually use `tags` files.



On 28 April 2014 09:40, Roman Cheplyaka <roma@ro-che.info> wrote:
* Simon Marlow <marlowsd@gmail.com> [2014-04-28 09:26:23+0100]
> On 25/04/2014 17:57, Roman Cheplyaka wrote:
> >* Edward Kmett <ekmett@gmail.com> [2014-04-25 11:22:46-0400]
> >>+1 from me. I have a lot of projects that suffer with 4 levels of vacuous
> >>subdirectories just for this.
> >>
> >>In theory cabal could support this on older GHC versions by copying all of the
> >>files to a working dir in dist with the expected layout on older GHCs.
> >>
> >>That would enable this to get much greater penetration more quickly.
> >
> >I'd really not want that people start putting ghc-options: -isrc=...
> >into their cabal files. That'd make them irrecoverably ghc-specific, as no other
> >tool will know how to process the files unless it reads ghc-options.
>
> No, the idea would be to use hs-source-dirs like this:
>
>   hs-source-dirs: A.B.C=src
>
> Cabal just passes this in a -i option to GHC, so it almost Just Works,
> except that Cabal needs to preprocess some source files so it needs to find
> them, and also sdist needs to find source files.

In that case, I'm in favour of this proposal.

Please consider the reversed syntax instead:

  hs-source-dirs: src=A.B.C

I find it more intuitive, because A.B.C becomes sort of an optional parameter,
the empty prefix being its default value.

Roman

_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users




--
Alois Cochard
http://aloiscochard.blogspot.com
http://twitter.com/aloiscochard
http://github.com/aloiscochard