<div dir="ltr">Hello all,<br><br>I&#39;m initiating this discussion per suggestion of SP Jones and following from [1]. The issue is: SYB is being moved out of base into its own package. However, the Data class is, in a way, tied to base since it depends on the deriving mechanism.<br>
<br>Therefore, it was suggested that the entire Data.Generics.Basics module [2] should remain in base. This module defines the Data class and several associated functions and datatypes. I don&#39;t think anyone objected to this so far: please correct me if I&#39;m wrong, or object now.<br>
<br>Then it was also suggested that Data.Generics.Instances [3] could stay in base (perhaps inside Basics as well). This, however, would prevent dealing with the &quot;dubious&quot; Data instances [4], and this was one of the motivating factors to split SYB from base. This refers concretely to the instances:<br>
<blockquote><span style="font-family: courier new,monospace;">instance (Data a, Data b) =&gt; Data (a -&gt; b)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">instance Typeable a =&gt; Data (IO a)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">instance Typeable a =&gt; Data (Ptr a)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">instance Typeable a =&gt; Data (StablePtr a)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">instance Typeable a =&gt; Data (IORef a)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">instance Typeable a =&gt; Data (ForeignPtr a)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">instance (Typeable s, Typeable a) =&gt; Data (ST s a)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">instance Typeable a =&gt; Data (TVar a)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">instance Typeable a =&gt; Data (MVar a)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">instance Typeable a =&gt; Data (STM a)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">instance (Data a, Integral a) =&gt; Data (Ratio a)</span><br></blockquote><br>These instances are defined in such a way that they do not traverse the datatype. In fact, there is no other possible implementation, and this implementation at least allows for datatypes which contain both &quot;regular&quot; and &quot;dubious&quot; elements to still have their &quot;regular&quot; elements traversed.<br>
However, this implies that a user cannot redefine such instances even in the case where s/he knows extra information about these types that would allow for a more useful instance definition, for instance.<br><br>Claus, please correct me if I&#39;m wrong, but if the 11 &quot;dubious&quot; instances (or perhaps less, given your message in [5]) go in the syb package and the remaining, &quot;standard&quot; ones stay in base, we:<br>
- Mantain backwards compatibility regarding SYB in 6.10, and<br>- Can still deal with the issue by releasing a new version of the syb package later, independently of GHC.<br>Since the deadline for 6.10 is approaching I&#39;m assuming that we should try to minimize the changes there, while keeping future development in the syb package as open as possible.<br>
<br><br>Finally, there are module naming issues, which are probably secondary to the issue above and can be dealt with separately and later.<br><br><br>Thanks,<br>Pedro<br><br>[1] The base library and GHC 6.10: <a href="http://thread.gmane.org/gmane.comp.lang.haskell.libraries/9929">http://thread.gmane.org/gmane.comp.lang.haskell.libraries/9929</a><br>
[2] <a href="http://www.haskell.org/ghc/dist/stable/docs/libraries/base/Data-Generics-Basics.html">http://www.haskell.org/ghc/dist/stable/docs/libraries/base/Data-Generics-Basics.html</a><br>[3] <a href="http://www.haskell.org/ghc/dist/stable/docs/libraries/base/Data-Generics-Instances.html">http://www.haskell.org/ghc/dist/stable/docs/libraries/base/Data-Generics-Instances.html</a><br>
[4] <a href="http://www.haskell.org/pipermail/generics/2008-June/000347.html">http://www.haskell.org/pipermail/generics/2008-June/000347.html</a><br>[5] <a href="http://article.gmane.org/gmane.comp.lang.haskell.libraries/9957">http://article.gmane.org/gmane.comp.lang.haskell.libraries/9957</a><br>
</div>