OverloadedLists
Simon Peyton-Jones
simonpj at microsoft.com
Thu Feb 14 16:10:19 CET 2013
| Finally I managed to build again (don't know what's wrong with my
| system, I built on a virtual machine instead now), and the tests pass. I
| attached the four patches, they were created with git diff --no-prefix,
| and their name specifies the submodule they are to be applied to. I hope
| it isn't to late to include them in 7.8. Should I publish them somewhere
| else also, or is this fine?
Great. It's done! Thanks for all your work on this.
Would you like to update the wiki page? http://hackage.haskell.org/trac/ghc/wiki/OverloadedLists
You probably don't want to mention your repo any more; and please just check the rest to make sure it's accurate.
I did quite a bit of refactoring, especially to the type checking of arithmetic sequences, which had lots of duplication; fixed the documentation which was out of date; fixed various error message changes in the main testsuite; and committed.
Simon
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(-)
More information about the ghc-devs
mailing list