<br><br><div class="gmail_quote">2012/2/25 Andres Löh <span dir="ltr"><<a href="mailto:andres.loeh@googlemail.com">andres.loeh@googlemail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">> Would you have an example of a type for which it would be useful to have<br>
> a DeepSeq instance, and that would require a V1 instance? I cannot think<br>
> of one now; I originaly thought it would be necessary to permit deriving<br>
> DeepSeq instances for types tagged with "void" types, but as José<br>
> explained, in that case, the V1 instance isn't needed because those void<br>
> types don't show up in the representation.<br>
<br>
</div>While void datatypes are rare, it just doesn't make sense to exclude<br>
them. It's an arbitrary restriction. Here's a constructed example:<br>
<br>
data X a = C1 Int | C2 a<br>
data Z -- empty<br>
<br>
type Example = X Z<br>
<br>
We're using Z as a parameter to X in order to exclude the use of the<br>
C2 case. Without a V1 case, you cannot use deepSeq on values of type<br>
Example.<br></blockquote><div><br>Yes, I agree. There should be a V1 instance, and it should return `undefined`. This gives the expected behavior of `seq` on an empty datatype, I think. If there is no V1 instance, you'll get a type-checking error (no instance for V1), preventing generic deepseq on any datatype that happens to use an empty datatype in its definition.<br>
<br><br>Cheers,<br>Pedro<br><br></div></div>