Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Rel8able to work with polymorphic types (#113)
Currently, a declaration such as: ```haskell newtype IdRecord a f = IdRecord { recordId :: Column f a } deriving Generic instance DBType a => Rel8able (IdRecord a) ``` Will fail, producing the error: ``` • Could not deduce (rel8-1.0.0.1:Rel8.Generic.Rel8able.Serialize (a Data.Type.Equality.== Identity a) (Expr a) a) arising from a use of ‘rel8-1.0.0.1:Rel8.Generic.Rel8able.$dmgfromColumns’ from the context: DBType a bound by the instance declaration at lib/CircuitHub/Model/Types.hs:231:10-42 ``` The stuck `==` type family gets in the way, even though we can clearly see that this is `False`. This commit fixes this error by introducing a variation of `==` that anticipates this case, adding an explicit pattern. With this new definition of `==`, things work as expected.
- Loading branch information