[commit: ghc] master: Add OverloadedLists, allowing list syntax to be overloaded (3234a4a)

Simon Peyton Jones simonpj at microsoft.com
Thu Feb 14 15:56:14 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3234a4ade7204c4206831b4c1dc4a8b23624cc6b

>---------------------------------------------------------------

commit 3234a4ade7204c4206831b4c1dc4a8b23624cc6b
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Feb 14 13:04:14 2013 +0000

    Add OverloadedLists, allowing list syntax to be overloaded
    
    This work was all done by
       Achim Krause <achim.t.krause at gmail.com>
       George Giorgidze <giorgidze at gmail.com>
       Weijers Jeroen <jeroen.weijers at uni-tuebingen.de>
    
    It allows list syntax, such as [a,b], [a..b] and so on, to be
    overloaded so that it works for a variety of types.
    
    The design is described here:
        http://hackage.haskell.org/trac/ghc/wiki/OverloadedLists
    
    Eg. you can use it for maps, so that
            [(1,"foo"), (4,"bar")] :: Map Int String
    
    The main changes
     * The ExplicitList constructor of HsExpr gets witness field
     * Ditto ArithSeq constructor
     * Ditto the ListPat constructor of HsPat
    
    Everything else flows from this.

 compiler/deSugar/Check.lhs        |   15 ++--
 compiler/deSugar/Coverage.lhs     |   16 +++-
 compiler/deSugar/DsArrows.lhs     |    2 +-
 compiler/deSugar/DsExpr.lhs       |   42 +++++++----
 compiler/deSugar/DsMeta.hs        |    7 +-
 compiler/deSugar/Match.lhs        |   31 ++++++--
 compiler/hsSyn/Convert.lhs        |    6 +-
 compiler/hsSyn/HsExpr.lhs         |   12 ++-
 compiler/hsSyn/HsPat.lhs          |   12 ++-
 compiler/hsSyn/HsUtils.lhs        |    6 +-
 compiler/main/DynFlags.hs         |    2 +
 compiler/parser/Parser.y.pp       |   12 ++--
 compiler/parser/RdrHsSyn.lhs      |    4 +-
 compiler/prelude/PrelNames.lhs    |   26 ++++++-
 compiler/prelude/TysWiredIn.lhs   |    2 +-
 compiler/rename/RnEnv.lhs         |   18 +++--
 compiler/rename/RnExpr.lhs        |   45 +++++++----
 compiler/rename/RnPat.lhs         |   21 ++++-
 compiler/typecheck/TcExpr.lhs     |  111 ++++++++++++++++----------
 compiler/typecheck/TcHsSyn.lhs    |   30 ++++++--
 compiler/typecheck/TcHsType.lhs   |    2 +-
 compiler/typecheck/TcPat.lhs      |   14 +++-
 compiler/typecheck/TcRnDriver.lhs |    2 +-
 compiler/typecheck/TcRnTypes.lhs  |    2 +
 compiler/utils/Outputable.lhs     |    4 +-
 docs/users_guide/flags.xml        |    7 ++
 docs/users_guide/glasgow_exts.xml |  157 +++++++++++++++++++++++++++++++++++++
 27 files changed, 469 insertions(+), 139 deletions(-)


Diff suppressed because of size. To see it, use:

    git show 3234a4ade7204c4206831b4c1dc4a8b23624cc6b



More information about the ghc-commits mailing list