Thanks for the clarification.<br>But could not class Data have been used for generic Deriving of classes? I imagine it would have been harder, but I fail to see if would have been possible...<br><br><div class="gmail_quote">

Hi Yves,<br><br>GHC.Generics [1] and SYB [2] are two rather different approaches to generic programming. There are things that can be done in one but not in the other, and there are things that are easier on one rather than the other. For instance, SYB tends to be very useful for large AST transformations, with functions that have a general behaviour but a couple of particular cases for a few constructors. GHC.Generics, on the other hand, can encode functions such as generic fmap and traverse. It lends itself better to optimisation since it doesn&#39;t use runtime casts, and as such tends to be faster than SYB. It isn&#39;t planned to replace SYB.<br>

I&#39;d have a question concerning GHC.Generics: how does it relate to SYB&#39;s Data.Generics?<br>Is it intended to replace it or complete it?<br>In other words: does class Data.Generics.Data class do things that class GHC.Generics.Generic can&#39;t do?<br>

<div style="word-wrap:break-word"><div>Hi all,</div><div><br></div>I&#39;ve been playing with GHC&#39;s new generics features (see <a href="http://www.haskell.org/ghc/docs/latest/html/users_guide/generic-programming.html" target="_blank">http://www.haskell.org/ghc/docs/latest/html/users_guide/generic-programming.html</a>). All the documentation I&#39;ve seen suggests creating a &quot;helper class&quot; -- for instance, the GSerialize class in the above link -- on which one defines generic instances. <div>

<br></div><div>It seems to me that this isn&#39;t necessary. For example, here&#39;s the the example from the GHC docs, but without a helper class:</div><div><br></div><div>&gt; -- set the phantom type of Rep to (), to avoid ambiguity</div>