Add OverloadedLists, allowing list syntax to be overloaded
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 14 Feb 2013 13:04:14 +0000 (13:04 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 14 Feb 2013 13:04:14 +0000 (13:04 +0000)
commit3234a4ade7204c4206831b4c1dc4a8b23624cc6b
treedffbc59d2ae6152b0aed24e83f64a9a70e5d42ca
parent6571f4f110248221fb3fa0ac8e5b2584cb2c5b84
Add OverloadedLists, allowing list syntax to be overloaded

This work was all done by
   Achim Krause <achim.t.krause@gmail.com>
   George Giorgidze <giorgidze@gmail.com>
   Weijers Jeroen <jeroen.weijers@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.
27 files changed:
compiler/deSugar/Check.lhs
compiler/deSugar/Coverage.lhs
compiler/deSugar/DsArrows.lhs
compiler/deSugar/DsExpr.lhs
compiler/deSugar/DsMeta.hs
compiler/deSugar/Match.lhs
compiler/hsSyn/Convert.lhs
compiler/hsSyn/HsExpr.lhs
compiler/hsSyn/HsPat.lhs
compiler/hsSyn/HsUtils.lhs
compiler/main/DynFlags.hs
compiler/parser/Parser.y.pp
compiler/parser/RdrHsSyn.lhs
compiler/prelude/PrelNames.lhs
compiler/prelude/TysWiredIn.lhs
compiler/rename/RnEnv.lhs
compiler/rename/RnExpr.lhs
compiler/rename/RnPat.lhs
compiler/typecheck/TcExpr.lhs
compiler/typecheck/TcHsSyn.lhs
compiler/typecheck/TcHsType.lhs
compiler/typecheck/TcPat.lhs
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcRnTypes.lhs
compiler/utils/Outputable.lhs
docs/users_guide/flags.xml
docs/users_guide/glasgow_exts.xml