<div dir="ltr"><div><div><div><div><div><div>Hi,<br></div>I've tried the make an instance of NFData for all types, although I have a problem with the GATD:<br><br><br><i>data MyGADT a where<br>   MyField :: b -> MyGADT (Maybe b)<br>
<br>instance NFData a => NFData (MyGADT a) where<br>   rnf (MyField b) = (rnf b)<br></i><br></div>Gives me :<br>    Could not deduce (NFData b) arising from a use of `rnf'<br>    from the context (NFData a)<br><br>
</div>Which I understand (that's because a ~ <i>Maybe b </i>and not<i> a ~ b </i>due to the declaration of <i>MyField b </i>being of type<i> </i><i><i>MyGADT (Maybe b)</i></i>)<i><br></i></div><i>But I have no idea how to solve that??<br>
</i></div><i>Thanks...<br></i></div><i>Corentin<br></i><div><div><div><div><div><div><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 13, 2014 at 1:10 AM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On Sun, Jan 12, 2014 at 6:44 PM, Corentin Dupont <span dir="ltr"><<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>One question:<br></div>Since it works with putStrLn, can I simulate the behaviour of putStrLn without actually... printing anything? As a workaround...</div>

</blockquote><div><br></div></div><div>Worst case, open a handle on /dev/null and hPutStr to it.</div><div><br></div><div>I'd probably try to figure out how to write appropriate NFData instances, though.</div><div><br>
</div>
</div><div class="im">-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div>

<div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div></div>
</blockquote></div><br></div>