<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 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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="color:#1F497D">We’ve made a Wiki page with some relevant information,
<a href="https://ghc.haskell.org/trac/ghc/wiki/BurningBridgesSlowly">https://ghc.haskell.org/trac/ghc/wiki/BurningBridgesSlowly</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<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:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Libraries [mailto:libraries-bounces@haskell.org]
<b>On Behalf Of </b>Augustsson, Lennart<br>
<b>Sent:</b> 27 January 2015 10:33<br>
<b>To:</b> libraries@haskell.org<br>
<b>Subject:</b> Drastic Prelude changes imminent<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The next version (7.10) of GHC is slated to have a drastically changed Prelude.<o:p></o:p></p>
<p class="MsoNormal">This message is very late in the release process, but I would urge caution before changing.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The changes are (aptly) named the Burning Bridges Proposal (BBP).<o:p></o:p></p>
<p class="MsoNormal">Even though the work has been going on for a while, it seems that this<o:p></o:p></p>
<p class="MsoNormal">change is coming as a surprise to many people (including Simon Peyton<o:p></o:p></p>
<p class="MsoNormal">Jones).  In summary, it generalizes many list operation, e.g., foldr,<o:p></o:p></p>
<p class="MsoNormal">to be overloaded.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">There is much to welcome in BBP, but changing the Prelude cannot be<o:p></o:p></p>
<p class="MsoNormal">done lightly since it really is like changing the language.<o:p></o:p></p>
<p class="MsoNormal">So I think it's really important for a large number of people to be able to<o:p></o:p></p>
<p class="MsoNormal">try out such changes before they come into effect, and to have time<o:p></o:p></p>
<p class="MsoNormal">to let the changes stabilize (you rarely get it right the first time).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I've discussed this with a number of people, including Simon PJ, and<o:p></o:p></p>
<p class="MsoNormal">we have concrete proposals.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Proposal 1:<o:p></o:p></p>
<p class="MsoNormal">*    Add a new pragma<o:p></o:p></p>
<p class="MsoNormal">        {-# LANGUAGE Prelude=AlternativePrelude #-}<o:p></o:p></p>
<p class="MsoNormal">      *   This is a new feature, but it is easy and low-risk to implement.<o:p></o:p></p>
<p class="MsoNormal">      *   Which Prelude you use really is a language choice; appropriate for a LANGUAGE pragma.<o:p></o:p></p>
<p class="MsoNormal">      *   Semantics is name-space only: import Prelude (); import AlternativePrelude<o:p></o:p></p>
<p class="MsoNormal">      *   No effect on desugaring or typing of built-in syntax (list comprehensions, do-notation etc).<o:p></o:p></p>
<p class="MsoNormal">*    Ship with both old and new prelude.<o:p></o:p></p>
<p class="MsoNormal">*    So now old and new behaviour are easy to achieve, in the module or in a .cabal file.<o:p></o:p></p>
<p class="MsoNormal">*    The question becomes "what is the default".<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Proposal 2:<o:p></o:p></p>
<p class="MsoNormal">*    Make the default be the old rather than the new.<o:p></o:p></p>
<p class="MsoNormal">      *   Altering the default Prelude API should be done slowly, with lots of warning; because all users get it willy-nilly.<o:p></o:p></p>
<p class="MsoNormal">      *   Unlike AMP, the change is controversial (clearly).<o:p></o:p></p>
<p class="MsoNormal">      *   Easier to make changes to New Prelude if it isn't the default.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">That's it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Discussing the BBP proposal we also came up with a number of technical questions:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Q1<o:p></o:p></p>
<p class="MsoNormal">An alternative to Foldable would be <o:p></o:p></p>
<p class="MsoNormal">  class Enumerable t where<o:p></o:p></p>
<p class="MsoNormal">    toList :: t a -> [a]   -- Implementations should use 'build'<o:p></o:p></p>
<p class="MsoNormal">Is Foldable more general (or efficient) than a Enumerable class, plus fusion? 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Consider a new data type X a.  I write<o:p></o:p></p>
<p class="MsoNormal">     foldX :: (a -> b -> b) -> b -> X a -> b<o:p></o:p></p>
<p class="MsoNormal">     foldX = ...lots of code...<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">     toList :: X a -> [a]  {-# INLINE toList #-}<o:p></o:p></p>
<p class="MsoNormal">     toList x = build (\c n. foldX c n x)<o:p></o:p></p>
<p class="MsoNormal">            <o:p></o:p></p>
<p class="MsoNormal">So now toList is small and easy to inline.  Every good list consumer of a call to toList will turn into a call to foldX, which is what we want.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Q2<o:p></o:p></p>
<p class="MsoNormal">What are the criteria for being in Foldable?<o:p></o:p></p>
<p class="MsoNormal">For instance, why are 'sum', 'product' in Foldable, but not 'and', 'or'?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Q3<o:p></o:p></p>
<p class="MsoNormal">What's the relationship of Foldable to GHC.Exts.IsList?<o:p></o:p></p>
<p class="MsoNormal">Which also has toList, fromList, and does work with ByteString.<o:p></o:p></p>
<p class="MsoNormal">*  For example, could we use IsList instead of Foldable?<o:p></o:p></p>
<p class="MsoNormal">    Specifically, Foldable does not use its potential power to apply the type constructor t to different arguments.  (Unlike Traversable which does.)<o:p></o:p></p>
<p class="MsoNormal">        foldr :: IsList l => (Item l->b->b) -> b -> l -> b<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">  -- Lennart<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard
 Chartered Bank and their subsidiaries at <br>
<a href="http://www.standardchartered.com/en/incorporation-details.html">http://www.standardchartered.com/en/incorporation-details.html</a><br>
<br>
Insofar as this communication contains any market commentary, the market commentary has been prepared by a sales and/or trading desk of Standard Chartered Bank or its affiliate. It is not and does not constitute research material, independent research, recommendation
 or financial advice. Any market commentary is for information purpose only and shall not be relied for any other purpose, and is subject to the relevant disclaimers available at
<a href="http://wholesalebanking.standardchartered.com/en/utility/Pages/d-mkt.aspx">
http://wholesalebanking.standardchartered.com/en/utility/Pages/d-mkt.aspx</a>.<br>
<br>
Please visit <a href="http://wholesalebanking.standardchartered.com/en/capabilities/financialmarkets/Pages/doddfrankdisclosures.aspx">
http://wholesalebanking.standardchartered.com/en/capabilities/financialmarkets/Pages/doddfrankdisclosures.aspx</a> for important information with respect to derivative products.<o:p></o:p></span></p>
</div>
<br clear="both">
This email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please delete all copies and notify the sender immediately. You may wish to refer to the incorporation details of Standard Chartered PLC, Standard Chartered Bank and their subsidiaries at <BR>
http://www.standardchartered.com/en/incorporation-details.html<BR>
<BR>
Insofar as this communication contains any market commentary, the market commentary has been prepared by a sales and/or trading desk of Standard Chartered Bank or its affiliate. It is not and does not constitute research material, independent research, recommendation or financial advice. Any market commentary is for information purpose only and shall not be relied for any other purpose, and is subject to the relevant disclaimers available at http://wholesalebanking.standardchartered.com/en/utility/Pages/d-mkt.aspx.<BR>
<BR>
Please visit http://wholesalebanking.standardchartered.com/en/capabilities/financialmarkets/Pages/doddfrankdisclosures.aspx  for important information with respect to derivative products.<BR>
</body>
</html>