On 5/4/12 10:44 AM, Andreas Abel wrote:
open import Data.Functor.Constant renaming (Constant to K)
Maybe that could be a feature of future Haskell as well?
Seems like it should be easy enough to implement too (sayeth he who hasn't hacked on GHC). The real difficulty methinks would be in specifying the module import syntax, since there's a conflict between (1) creating a coherent integrated system for qualified, unqualified, renamed, explicit, and hidden imports (plus any other features we want to add at the same time); and (2) backwards compatibility.
Actually I'm pretty sure there is no such issue. As it is, "as" and "hiding" aren't even keywords; the syntax is flexible enough that they don't need to be keywords to avoid ambiguity. I don't think the proposed syntax is a problem either (although I think I would reuse "as" instead of using "to", just because we already have it) since (a) it's already inside a new chunk of syntax and (b) even without that, no similar syntax supports two tokens next to each other already, except "module" in export lists (so not even part of this particular element, even if syntax block is similar) which is already distinguished as a keyword.
--