
8 Nov
2013
8 Nov
'13
9:09 a.m.
I seem to have worked around this by hand rolling instances for TransactionType as below. I would still like to understand how to make this work with mkPersist though. instance G.PersistField TransactionType where persistName _ = "TransactionType" toPersistValues = GG.primToPersistValue fromPersistValues = GG.primFromPersistValue dbType _ = G.DbTypePrimitive G.DbString False Nothing Nothing instance G.PrimitivePersistField TransactionType where toPrimitivePersistValue _ a = G.PersistString (show a) fromPrimitivePersistValue _ (G.PersistString s) = read s fromPrimitivePersistValue _ _ = error "Expected PersistString"