I think so.. it's described on the wiki. Achim may be able to help too
Simon
From: Johan Tibell [mailto:johan.tibell@gmail.com]
Sent: 14 February 2013 15:40
To: ghc-devs@haskell.org
Cc: Simon Peyton-Jones; Roman Leshchinskiy
Subject: Re: [commit: ghc] master: Add OverloadedLists, allowing list syntax to be overloaded (3234a4a)
Did we end up supporting a length hint so we can efficiently create e.g. vectors that need upfront allocation of the space before writing the elements? Or is the plan to do like we for String and have literals desugar to e.g.
fromIntList# :: Int# -> Ptr Int# -> [Int]
intList# :: Ptr Int#
intList# = [1,2,3,4]#
myliteral = fromList (fromIntList# 4 intList#)
On Thu, Feb 14, 2013 at 6:56 AM, Simon Peyton Jones mailto:simonpj@microsoft.com> wrote:
Repository : ssh://darcs.haskell.org//srv/darcs/ghchttp://darcs.haskell.org/srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/3234a4ade7204c4206831b4c1dc4a8...
---------------------------------------------------------------
commit 3234a4ade7204c4206831b4c1dc4a8b23624cc6b
Author: Simon Peyton Jones mailto:simonpj@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 mailto:achim.t.krause@gmail.com>
George Giorgidze mailto:giorgidze@gmail.com>
Weijers Jeroen mailto: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.
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
_______________________________________________
ghc-commits mailing list
ghc-commits@haskell.orgmailto:ghc-commits@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-commits