[Haskell-cafe] Re: Packages and modules
Brian Hulley
brianh at metamilk.com
Wed Jul 5 09:51:15 EDT 2006
Simon Peyton-Jones wrote:
> In response to Brian and Ian's helpful comments, I've added a bunch
> more stuff to our proposal about packages. If I have missed
> anything, let me know.
>
> http://hackage.haskell.org/trac/ghc/wiki/GhcPackages
>
> If you or anyone else thinks the choices made there are poor ones,
> continue to say so. It's a helpful process.
I think the proposed system is too complicated. I'd have thought there were
some simple aims:
1) Backwards compatibility so existing code doesn't break
2) Allow people to use per-package module namespaces in new code
3) Allow package names to be URLs (Marc Weber's idea
http://www.haskell.org//pipermail/haskell-cafe/2006-June/016378.html )
And the following possible solutions:
1) The current "import" syntax would refer to shared namespace imports
(exactly as at present)
2) A new keyword, "use", would indicate use of per-package namespaces
3) Putting the package name in quotes allows more complex package names
including URLs and packages located in a specific folder etc in future, and
also makes it clear that the package name is an OS filename (albeit
conforming to a special form) not a Haskell id, and also allows the "use"
syntax to be very concise since a quoted name cannot be confused with a
modid.
So instead of just taking this simple solution, the wiki proposal is instead
destroying the beauty of the per-package namespace idea by incorporating
into it the existing shared namespaces with their attendant problems,
instead of just letting the existing messy system die a natural death
through the syntactic isolation I proposed.
In three years' time, how easy will it be to explain Haskell's module system
to a new programmer?
Regards, Brian.
--
Logic empowers us and Love gives us purpose.
Yet still phantoms restless for eras long past,
congealed in the present in unthought forms,
strive mightily unseen to destroy us.
http://www.metamilk.com
More information about the Haskell-Cafe
mailing list