The issue is that the Haskell's Text type only supports conversions from PostgreSQL's text, char, varchar, and a few other types. So this is why converting to Text first doesn't work.
I'm trying to use postgresql enum types to represent Haskell types like in the code snippet below but an receiving the following error:"Incompatible {errSQLType = "x", errHaskellType = "Text", errMessage = "types incompatible"}"In other areas of my code (not shown) I'm successfully using Text to convert to and from Postgersql enum types but it doesn't seem to work in the case below. Any ideas what I'm doing wrong?Thanks, Lukeimport Database.PostgreSQL.Simple.FromField (FromField, fromField) import Database.PostgreSQL.Simple.FromRow (FromRow, field, fromRow) import Database.PostgreSQL.Simple.SqlQQ (sql) data X = X Float | Y Float buildX :: Text -> Float -> X buildX "x" = X buildX "y" = Y instance FromField (Float -> X) where fromField f v = buildX <$> fromField f v instance FromRow X where fromRow = field <*> (field :: RowParser Float)
_______________________________________________
database-devel mailing list
database-devel@haskell.org
http://www.haskell.org/mailman/listinfo/database-devel