<div dir="ltr">For that to work, I believe you must enable FlexibleInstances and possibly also OverlappingInstances (depending on what the rest of the GADT looks like).</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Sun, Jan 19, 2014 at 3:00 PM, Carter Schonwald <span dir="ltr"><<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Try <div><br></div><div><i style="background-color:rgba(255,255,255,0)"><font>instance NFData a => NFData (MyGADT (Maybe a) )<span></span></font></i><div><div class="h5"><br><br>On Sunday, January 19, 2014, Corentin Dupont <<a href="mailto:corentin.dupont@gmail.com" target="_blank">corentin.dupont@gmail.com</a>> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>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>On Sun, Jan 12, 2014 at 6:44 PM, Corentin Dupont <span dir="ltr"><<a>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>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a>allbery.b@gmail.com</a>                                  <a>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>
</blockquote></div></div></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>