I have a problem with UndecidableInstances that I could not figure out how to avoid using newtype . Here is what I originally:
{-
The message I receive is
amy9.hs:28:10: Constraint is no smaller than the instance head in the constraint: Record (DBRecord d) (Use -XUndecidableInstances to permit this) In the instance declaration for `Universe (SimpleUniverse d)'
I want to avoid UndecidableInstances because this code will be in a reusable library, so I will try to declare newtype :
newtype SimpleUniverse2 u = SimpleUniverse2 { fromAdditiveGroup :: u } instance (Record (DBRecord u)) => Universe (SimpleUniverse2 u) where type UAgent (SimpleUniverse2 u) = DBRecord u type UAgentDB (SimpleUniverse2 u) = u -- plus other stuff
But I get the same error. I read the answers to other questions about UndecidableInstances , but I could not solve this problem.
haskell
mhwombat
source share