[GHC] #9590: AMP breaks `haskell2010` package

GHC ghc-devs at haskell.org
Thu Feb 12 12:17:14 UTC 2015


#9590: AMP breaks `haskell2010` package
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                   Owner:  ekmett
            Type:  bug               |                  Status:  closed
        Priority:  high              |               Milestone:  7.10.1
       Component:  Core Libraries    |                 Version:  7.9
      Resolution:  fixed             |                Keywords:  AMP,
Operating System:  Unknown/Multiple  |  report-impact
 Type of failure:  GHC rejects       |            Architecture:
  valid program                      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:  Phab:D510
-------------------------------------+-------------------------------------

Comment (by hvr):

 Even something like `{-# LANGUAGE
 RebindableSyntax=haskell2010:Prelude.Syntax -#}` would already be an
 improvement with the following semantic:

  - desugaring like `-XRebindableSyntax`,
  - *but* rather than the local scope, only what's exported by the
 `Prelude.Syntax` module (from the `haskell2010` package) is used for
 desugaring,
  - and `Prelude.Syntax` can be a hidden module of the `haskell2010`
 package (to avoid polluting the module namespace)

 This could allow (maybe) to write a simple shell-script wrapper `ghci2010`
 (or `ghc2010`) in the style of

 {{{#!bash
 #!/bin/sh

 ghci -XHaskell2010 \
   -hide-all-packages -package haskell2010 \
   -XRebindableSyntax=haskell2010:Prelude.Syntax $*
 }}}

 This is similar to the `{-# LANGUAGE Prelude=AlternatePrelude #-}` idea we
 were floating recently, but also takes into account desugaring.

 NB: this doesn't solve the issue of packages compiled against `base` and
 `haskell2010` to have diverging typeclass hierarchies. But I don't think
 we can solve that without a significant amount of complexity. I'd rather
 suggest to instead have packages actively support `haskell2010` (maybe as
 Cabal configuration option via flags, or via hs2010-compat-layer packages
 -- not sure yet which is best) for those few packages where there's enough
 demand to (like e.g. something like `containers`).

 My main motivation for a `haskell2010` package is to have a reference
 implementation for the Haskell 2010 report (which can be useful for
 teaching, or for being able to compile some ancient "pure" Haskell2010
 code with the latest GHC), rather than having full Hackage
 compatibility...

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9590#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list