<br><br><div class="gmail_quote">2012/2/24 Maxime Henrion <span dir="ltr">&lt;<a href="mailto:mhenrion@gmail.com">mhenrion@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5">On Fri, 2012-02-24 at 07:49 +0100, Jos Pedro Magalhes wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; 2012/2/23 Maxime Henrion &lt;<a href="mailto:mhenrion@gmail.com">mhenrion@gmail.com</a>&gt;<br>
&gt;<br>
&gt;         &gt; * Why do you have the instance:<br>
&gt;         &gt;<br>
&gt;         &gt; instance GDeepSeq V1 where grnf _ = ()<br>
&gt;         &gt;<br>
&gt;         &gt; The only way to construct values of a void type is using ⊥.<br>
&gt;         And I<br>
&gt;         &gt; would expect that rnf ⊥ = ⊥, not (). I think the best thing<br>
&gt;         is to just<br>
&gt;         &gt; remove the V1 instance.<br>
&gt;<br>
&gt;<br>
&gt;         This would have the consequence that any type tagged with a<br>
&gt;         phantom type<br>
&gt;         (for whatever reason) couldn&#39;t be used with deepseq, it would<br>
&gt;         return<br>
&gt;         bottom. What if I want to deepseq a 2-3 finger tree tagged<br>
&gt;         with a<br>
&gt;         type-level natural that ensures the proper shape of the tree<br>
&gt;         statically?<br>
&gt;         It seemed to me that I should be able to do that; this is why<br>
&gt;         I added<br>
&gt;         this V1 instance.<br>
&gt;<br>
&gt; I&#39;m not sure I understand your comment... V1 should only be used for<br>
&gt; datatypes without constructors, such as `data Empty`.<br>
<br>
</div></div>Yes, such as the usual type-level naturals (not using DataKinds):<br>
<br>
data Z<br>
data S n<br>
<br>
Those can be used to tag a type which also contains actual values that<br>
you would want to deepseq? For example, a length-type vector?</blockquote><div><br>But in those cases they are used as tags, not as values, and hence do not show up in the generic representation. So if all you want is to be able to deepseq a value of a type like<br>

<br><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;font-family:courier new,monospace" class="gmail_quote">data Proxy t = Proxy<br></blockquote><br>even if your value is of type `Proxy Ze`, you shouldn&#39;t need a `V1` instance.<br>

<br><br>Cheers,<br>Pedro<br><br></div></div>