Proposal: unify constant functors

Brandon Allbery allbery.b at
Sun May 6 03:20:41 CEST 2012

On Sat, May 5, 2012 at 8:36 PM, wren ng thornton <wren at> wrote:

> 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.

brandon s allbery                                      allbery.b at
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list