<div dir="ltr"><br><br><div class="gmail_quote">On Sat, Apr 9, 2011 at 11:16 PM, Clint Moore <span dir="ltr">&lt;<a href="mailto:clint@ivy.io">clint@ivy.io</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br><br><div class="gmail_quote"><div class="im">On Sat, Apr 9, 2011 at 12:13 PM, Michael Snoyman <span dir="ltr">&lt;<a href="mailto:michael@snoyman.com" target="_blank">michael@snoyman.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr"><br><div>I definitely don&#39;t want to deal with cabal flags for this, it would mean that some packages wouldn&#39;t install on your system depending on how you build Persistent. For your case, it might be acceptable to just use standalone deriving declarations, ie:</div>




<div><br></div><div>deriving instance Data SpeciesId</div><div>deriving instance Data Animal</div><div>...</div></div></blockquote><div><br></div></div><div>  I read the user&#39;s guide on how this works, but I think there might be something going on with the quasiquoter that is preventing it from working.  Or, more probable, I&#39;m doing it wrong.</div>


<div><br></div><div>{-# LANGUAGE StandaloneDeriving #-}</div><div class="im"><div>Species</div><div> name String Eq</div><div> deriving Data Typeable</div><div><br></div><div>Animal</div></div><div> species SpeciesId Eq</div>

<div class="im"><div> name String Eq</div>
<div> deriving Data Typeable</div></div><div> deriving instance Data SpeciesId</div><div><br></div><div>Any combination that I&#39;ve tried of &#39;deriving instance&#39; throws an illegal type constructor error.  Do you happen to have an example of this?</div>


<div><br></div></div>
</blockquote></div><br><div>This is most likely due to GHC stage restrictions. Try removing any mention of Data and Typeable from the entity declaration, and then just using &quot;deriving instance...&quot; code after the call to mkPersist.</div>

<div><br></div><div>Michael</div></div>