<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Verdana","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">I think so.. it&#8217;s described on the wiki. &nbsp;Achim may be able to help too<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><br>
Simon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Johan Tibell [mailto:johan.tibell@gmail.com]
<br>
<b>Sent:</b> 14 February 2013 15:40<br>
<b>To:</b> ghc-devs@haskell.org<br>
<b>Cc:</b> Simon Peyton-Jones; Roman Leshchinskiy<br>
<b>Subject:</b> Re: [commit: ghc] master: Add OverloadedLists, allowing list syntax to be overloaded (3234a4a)<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">fromIntList# :: Int# -&gt; Ptr Int# -&gt; [Int]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">intList# :: Ptr Int#<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">intList# = [1,2,3,4]#<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">myliteral = fromList (fromIntList# 4 intList#)<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">On Thu, Feb 14, 2013 at 6:56 AM, Simon Peyton Jones &lt;<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>&gt; wrote:<o:p></o:p></p>
<p class="MsoNormal">Repository : ssh://<a href="http://darcs.haskell.org/srv/darcs/ghc" target="_blank">darcs.haskell.org//srv/darcs/ghc</a><br>
<br>
On branch &nbsp;: master<br>
<br>
<a href="http://hackage.haskell.org/trac/ghc/changeset/3234a4ade7204c4206831b4c1dc4a8b23624cc6b" target="_blank">http://hackage.haskell.org/trac/ghc/changeset/3234a4ade7204c4206831b4c1dc4a8b23624cc6b</a><br>
<br>
&gt;---------------------------------------------------------------<br>
<br>
commit 3234a4ade7204c4206831b4c1dc4a8b23624cc6b<br>
Author: Simon Peyton Jones &lt;<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>&gt;<br>
Date: &nbsp; Thu Feb 14 13:04:14 2013 &#43;0000<br>
<br>
&nbsp; &nbsp; Add OverloadedLists, allowing list syntax to be overloaded<br>
<br>
&nbsp; &nbsp; This work was all done by<br>
&nbsp; &nbsp; &nbsp; &nbsp;Achim Krause &lt;<a href="mailto:achim.t.krause@gmail.com">achim.t.krause@gmail.com</a>&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp;George Giorgidze &lt;<a href="mailto:giorgidze@gmail.com">giorgidze@gmail.com</a>&gt;<br>
&nbsp; &nbsp; &nbsp; &nbsp;Weijers Jeroen &lt;<a href="mailto:jeroen.weijers@uni-tuebingen.de">jeroen.weijers@uni-tuebingen.de</a>&gt;<br>
<br>
&nbsp; &nbsp; It allows list syntax, such as [a,b], [a..b] and so on, to be<br>
&nbsp; &nbsp; overloaded so that it works for a variety of types.<br>
<br>
&nbsp; &nbsp; The design is described here:<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://hackage.haskell.org/trac/ghc/wiki/OverloadedLists" target="_blank">
http://hackage.haskell.org/trac/ghc/wiki/OverloadedLists</a><br>
<br>
&nbsp; &nbsp; Eg. you can use it for maps, so that<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [(1,&quot;foo&quot;), (4,&quot;bar&quot;)] :: Map Int String<br>
<br>
&nbsp; &nbsp; The main changes<br>
&nbsp; &nbsp; &nbsp;* The ExplicitList constructor of HsExpr gets witness field<br>
&nbsp; &nbsp; &nbsp;* Ditto ArithSeq constructor<br>
&nbsp; &nbsp; &nbsp;* Ditto the ListPat constructor of HsPat<br>
<br>
&nbsp; &nbsp; Everything else flows from this.<br>
<br>
&nbsp;compiler/deSugar/Check.lhs &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; 15 &#43;&#43;--<br>
&nbsp;compiler/deSugar/Coverage.lhs &nbsp; &nbsp; | &nbsp; 16 &#43;&#43;&#43;-<br>
&nbsp;compiler/deSugar/DsArrows.lhs &nbsp; &nbsp; | &nbsp; &nbsp;2 &#43;-<br>
&nbsp;compiler/deSugar/DsExpr.lhs &nbsp; &nbsp; &nbsp; | &nbsp; 42 &#43;&#43;&#43;&#43;&#43;&#43;&#43;----<br>
&nbsp;compiler/deSugar/DsMeta.hs &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp;7 &#43;-<br>
&nbsp;compiler/deSugar/Match.lhs &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; 31 &#43;&#43;&#43;&#43;&#43;&#43;--<br>
&nbsp;compiler/hsSyn/Convert.lhs &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp;6 &#43;-<br>
&nbsp;compiler/hsSyn/HsExpr.lhs &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 12 &#43;&#43;-<br>
&nbsp;compiler/hsSyn/HsPat.lhs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; 12 &#43;&#43;-<br>
&nbsp;compiler/hsSyn/HsUtils.lhs &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp;6 &#43;-<br>
&nbsp;compiler/main/DynFlags.hs &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp;2 &#43;<br>
&nbsp;compiler/parser/Parser.y.pp &nbsp; &nbsp; &nbsp; | &nbsp; 12 &#43;&#43;--<br>
&nbsp;compiler/parser/RdrHsSyn.lhs &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp;4 &#43;-<br>
&nbsp;compiler/prelude/PrelNames.lhs &nbsp; &nbsp;| &nbsp; 26 &#43;&#43;&#43;&#43;&#43;&#43;-<br>
&nbsp;compiler/prelude/TysWiredIn.lhs &nbsp; | &nbsp; &nbsp;2 &#43;-<br>
&nbsp;compiler/rename/RnEnv.lhs &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 18 &#43;&#43;&#43;--<br>
&nbsp;compiler/rename/RnExpr.lhs &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; 45 &#43;&#43;&#43;&#43;&#43;&#43;&#43;----<br>
&nbsp;compiler/rename/RnPat.lhs &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; 21 &#43;&#43;&#43;&#43;-<br>
&nbsp;compiler/typecheck/TcExpr.lhs &nbsp; &nbsp; | &nbsp;111 &#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;----------<br>
&nbsp;compiler/typecheck/TcHsSyn.lhs &nbsp; &nbsp;| &nbsp; 30 &#43;&#43;&#43;&#43;&#43;&#43;--<br>
&nbsp;compiler/typecheck/TcHsType.lhs &nbsp; | &nbsp; &nbsp;2 &#43;-<br>
&nbsp;compiler/typecheck/TcPat.lhs &nbsp; &nbsp; &nbsp;| &nbsp; 14 &#43;&#43;&#43;-<br>
&nbsp;compiler/typecheck/TcRnDriver.lhs | &nbsp; &nbsp;2 &#43;-<br>
&nbsp;compiler/typecheck/TcRnTypes.lhs &nbsp;| &nbsp; &nbsp;2 &#43;<br>
&nbsp;compiler/utils/Outputable.lhs &nbsp; &nbsp; | &nbsp; &nbsp;4 &#43;-<br>
&nbsp;docs/users_guide/flags.xml &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp;7 &#43;&#43;<br>
&nbsp;docs/users_guide/glasgow_exts.xml | &nbsp;157 &#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;<br>
&nbsp;27 files changed, 469 insertions(&#43;), 139 deletions(-)<br>
<br>
<br>
Diff suppressed because of size. To see it, use:<br>
<br>
&nbsp; &nbsp; git show 3234a4ade7204c4206831b4c1dc4a8b23624cc6b<br>
<br>
_______________________________________________<br>
ghc-commits mailing list<br>
<a href="mailto:ghc-commits@haskell.org">ghc-commits@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-commits" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-commits</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>