[ghc-steering-committee] Please review #270: Extend Term-Level Lookup rules

Iavor Diatchki iavor.diatchki at gmail.com
Mon Jun 1 16:39:48 UTC 2020


Hello,

I am the shepherd for proposal #270, and it is time for the committee to
review the proposal.  The discussion and the proposal are available here:
https://github.com/ghc-proposals/ghc-proposals/pull/270

Here is my summary of the proposal:

The proposal aims to solve the "namespace problem" which appears to largely
be related to fact that Haskell has two namespaces, and so types and values
may have the same name.

Proposed changes:
   1. Change the scoping rules for the language so that type names are in
scope at the value level, but values always shadow types.
   2. Add a new form of import, which can import only the names from a
particular names space
   3. Change the way built-in syntax for tuples and lists works and
deprecated ' and '' from DataKinds and TH respectively.   This is a bit
elaborate, have a look in the proposal for details
   4. Add a bunch of warnings that would trigger if you wrote code that
made use of Haskell's different name spaces

My recommendation is that the proposal is rejected, as I don't think that
these changes would help Haskell programmers, at least based on the way I
use Haskell.  In particular, here are my thoughts on each of the above
bullets:

   1. This is mostly about passing type arguments to functions---I would
prefer a notation that is more explicit about the fact that we are passing
in a type, and not just a normal argument.

   2. When I group things into modules, it is usually because they are
intended to be used together.  I think I would rarely want to import only
the types or only the values in a module, so I imagine it would be much
more common to have to write two imports.

   3. This is quite an intrusive change, that is likely to break code.  I
am also not keen to have to use type families, every time I want to use a
tuple.

   4. Using the same name for a data constructor and a type is very common
in Haskell.  I find it particularly useful when defining records.  I don't
need warnings to let me know that I've done it, as it is highly unlikely
that I did it on accident.

-Iavor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20200601/82c8c62e/attachment.html>


More information about the ghc-steering-committee mailing list