I am trying to use Data.Aeson.TH getiveJSON to instantiate ToJSON and FromJSON for MongoDB Data.Bson.
I am currently using:
$(deriveJSON id ''Data.Bson.Field) $(deriveJSON id ''Data.Bson.Value) $(deriveJSON id ''Data.Bson.Binary) $(deriveJSON id ''Data.Bson.UUID) $(deriveJSON id ''Data.Bson.UserDefined) $(deriveJSON id ''Data.Bson.Regex) $(deriveJSON id ''Data.Bson.Symbol) $(deriveJSON id ''Data.Bson.MinMaxKey) $(deriveJSON id ''Data.Bson.MongoStamp) $(deriveJSON id ''Data.Bson.Javascript) $(deriveJSON id ''Data.Bson.ObjectId) $(deriveJSON id ''Data.Bson.MD5) $(deriveJSON id ''Data.Bson.Function) $(deriveJSON id ''Data.Bson.UString)
Which generates the following error at compile time:
Exception when trying to run compile-time code: Data.Aeson.TH.withType: Unsupported type: TySynD Data.UString.UString [] (ConT Data.CompactString.UTF8.CompactString) Code: deriveJSON (id) 'UString
I think the problem here is that the line inside the BSON document is Ustring. I need to convert or otherwise display the expected UString in the BSON data to another type of String ... but a dead end as to how.
source share