<div dir="ltr"><span style="font-family: arial,helvetica,sans-serif;">Hello,</span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><div style="font-family: arial,helvetica,sans-serif;" class="gmail_quote">
On Wed, Sep 3, 2008 at 13:50, Simon Peyton-Jones <span dir="ltr"><<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
My reading of Claus's message is that, modulo discussion of some details of [partial], he'd go with that plan.<br>
<br>
Is that acceptable to others? If so, someone (Jose) needs to sort out the details. 19 Sept is GHC's release candidate, so we need this done well before then.</blockquote></div><br style="font-family: arial,helvetica,sans-serif;">
Are the details sorted out<span style="font-family: arial,helvetica,sans-serif;">? Summarizing:</span><br style="font-family: arial,helvetica,sans-serif;">
<ul><li>Data.Generics.Basics stays in base;</li><li>All other SYB modules besides Data.Generics.Instances go into a new 'syb' package;</li><li>Data.Generics.Instances is split in two, one part remaining in base and the other moving to the syb package.</li>
</ul><ol style="font-family: arial,helvetica,sans-serif;">
</ol><span style="font-family: arial,helvetica,sans-serif;">Regarding the instances, two aspects have to be considered:</span><br style="font-family: arial,helvetica,sans-serif;"><ol style="font-family: arial,helvetica,sans-serif;">
<li>Avoiding the implicit re-export of Data instances from modules in base;</li><li>Deciding which instances go where.</li></ol><span style="font-family: arial,helvetica,sans-serif;"><br>Regarding (1), the following changes need to be done:</span><br style="font-family: arial,helvetica,sans-serif;">
<ul><li>Ratio has to be fixed to have a consistent instance: either it's seen as an abstract datatype (therefore with undefined gunfold) or a gfoldl has to be defined matching its gunfold;</li><li>Complex should have its derived instance restored (or otherwise a manual instance with a proper gfoldl);</li>
<li>Other places that have to be changed:</li><ul><li>The Data instance of Data.Array should be moved from Data.Generics.Instances into Array, to avoid syb dependency;</li><li>The imports of SYB in the following modules should be fixed to avoid bringing into scope all the instances:</li>
</ul></ul>
<blockquote style="margin-left: 120px; font-family: arial,helvetica,sans-serif;">./containers/Data/IntMap.hs<br>
./containers/Data/IntSet.hs<br>./containers/Data/Map.hs<br>
./containers/Data/Sequence.hs<br>./containers/Data/Set.hs<br>
./containers/Data/Tree.hs<br>./network/Network/URI.hs<br>
./packedstring/Data/PackedString.hs</blockquote><div style="font-family: arial,helvetica,sans-serif;"><ul><ul><li>The following modules use of Ratio instances, which is not problematic if the instance for Ratio is fixed. Therefore no change is needed here:</li>
</ul></ul></div><blockquote style="margin-left: 120px; font-family: arial,helvetica,sans-serif;"><div>
./haskell-src/Language/Haskell/Syntax.hs<br></div>./template-haskell/Language/Haskell/TH/Quote.hs<br>
./template-haskell/Language/Haskell/TH/Syntax.hs</blockquote><div style="font-family: arial,helvetica,sans-serif;"><ul><ul><li>These modules
depend on an instance for ForeignPtr Word8. Instances for types with phantom types stay in base, since no suitable instance can be given (see (2) below). Therefore no change is needed here:<br></li></ul></ul></div><div style="font-family: arial,helvetica,sans-serif;">
<blockquote style="margin-left: 120px; font-family: arial,helvetica,sans-serif;">./bytestring/Data/ByteString/Internal.hs<br>
./bytestring/Data/ByteString/Lazy/Internal.hs</blockquote></div><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">Regarding (2), the separation of the 44 Data instances in Data.Generics.Instances is the following:</span><br>
<div style="font-family: arial,helvetica,sans-serif;"><ul><li>These 26 [standard] instances are uncontroversial and can accompany the Data class:</li></ul></div><div style="margin-left: 40px; font-family: arial,helvetica,sans-serif;">
<div style="margin-left: 40px;">[a] (Maybe a) (Either a b) () (,) (,,) (,,,) (,,,,) (,,,,,) (,,,,,,)<br>Bool Ordering Char Double Float Integer<br>Int Int8 Int16 Int32 Int64 Word Word8 Word16 Word32 Word64<br></div></div>
<div style="font-family: arial,helvetica,sans-serif;"><ul><li>These 2 instances could also be [standard] and stay in base, after fixing (see (1) above):</li></ul></div><div style="margin-left: 40px; font-family: arial,helvetica,sans-serif;">
<div style="margin-left: 40px;">Ratio Complex<br></div></div><div style="font-family: arial,helvetica,sans-serif;"><ul><li>
These 2 instances have phantom types. No good suggestion for what to do with them has shown up, therefore they stay in base as they are:<br></li></ul></div><div style="margin-left: 40px; font-family: arial,helvetica,sans-serif;">
<div style="margin-left: 40px;">
Ptr ForeignPtr<br></div></div><div style="font-family: arial,helvetica,sans-serif;"><ul><li>These 6 instances have abstract datatypes. Unless there is some reason to keep them in base, I suggest they go into the syb package:<br>
</li></ul><div style="margin-left: 80px;">DataType TyCon TypeRep Handle ThreadId StablePtr<br></div><ul><li>These 7 go in the syb package for future discussion:</li></ul></div>
<div style="margin-left: 40px; font-family: arial,helvetica,sans-serif;"><div style="margin-left: 40px;">
(a -> b) (IO a) (ST s a) (STM a) (IORef a) (TVar a) (MVar a)<br></div></div><div style="font-family: arial,helvetica,sans-serif;"><ul><li>The instance for Array is moved into Data.Array.</li></ul></div>
<br>Any remarks?<br><br style="font-family: arial,helvetica,sans-serif;"><div style="font-family: arial,helvetica,sans-serif;"><br>Thanks,<br>Pedro<br>
<br></div></div>