[Haskell-cafe] Foo.Bar.hs filenames poll
Merijn Verstraaten
merijn at inconsistent.nl
Mon Dec 19 10:55:24 UTC 2016
Hi Chris,
When I proposed adding support for more useful literate haskell extensions (i.e. allow Foo.lhs.md and Foo.lhs.rst) I encountered this too and after further investigation discovered that the Report has *0* specification of how module names are supposed to map to file names/directories. As such, it's impossible to actually write portable source code.
The common version of one directory per component with a file for the end seems the most commonly supported one across GHC, Hugs and UHC, which is I think why people using it (And probably why the multiple components in a file name is best avoided). For tools like stack (and everyone's sanity in general) I think it would be best to standardise how modules are resolved, but when I last floated this idea it got shot down, so....
Cheers,
Merijn
> On 18 Dec 2016, at 22:29, Christopher Done <chrisdone at gmail.com> wrote:
>
> Short version: here is the poll
> <https://docs.google.com/forms/d/e/1FAIpQLSdniOfoaX7xflgdWRnjVQ6_VLtk1oxA00SoK3KPMUsoTSPZDw/viewform?c=0&w=1>
>
> I noticed recently that Foo.Bar.hs is supported by GHC. I had always assumed it wasn't because people always use directories.
>
> I've never liked having separate directories for each level of hierarchy. It's easier to just list a list of files and script (e.g. even copying a file X.hs to Y.hs is a bummer). When opening them on GitHub you have to click through to get a complete picture of a project.
>
> Other languages do and don't do this. Lispers, for example, don't.
>
> How do other Haskellers feel about it? Would it mess with anybody's tooling or mojo if I switched to that style in my packages?
>
> For one I know that Stack (my own implementation), actually assumes hierarchical filenames. So I'd have to patch that to implement this. E.g.
>
>> Unable to find a known candidate for the Cabal entry "HIndent.Types", but did find: HIndent.Types.hs. If you are using a custom preprocessor for this module with its own file extension, consider adding the file(s) to your .cabal under extra-source-files.
>
> I suppose the real question is, as a language standard and a community preference, should this be considered a bug? Should people be free to use X.Y.hs or X/Y.hs styles?
>
> Ciao!
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20161219/d6913672/attachment.sig>
More information about the Haskell-Cafe
mailing list