
On Sat, Apr 9, 2011 at 11:16 PM, Clint Moore
On Sat, Apr 9, 2011 at 12:13 PM, Michael Snoyman
wrote: I definitely don't want to deal with cabal flags for this, it would mean that some packages wouldn'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:
deriving instance Data SpeciesId deriving instance Data Animal ...
I read the user'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'm doing it wrong.
{-# LANGUAGE StandaloneDeriving #-} Species name String Eq deriving Data Typeable
Animal species SpeciesId Eq name String Eq deriving Data Typeable deriving instance Data SpeciesId
Any combination that I've tried of 'deriving instance' throws an illegal type constructor error. Do you happen to have an example of this?
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 "deriving instance..." code after the call to mkPersist. Michael