@@ -436,8 +436,8 @@ sumToEncoding opts multiCons conName exp
436 array (encStr opts conName <%> fexp)
436 array (encStr opts conName <%> fexp)
437 TaggedObject{tagFieldName, contentsFieldName} ->
437 TaggedObject{tagFieldName, contentsFieldName} ->
439− ([|E.builder tagFieldName|] <:> encStr opts conName) <%>
439+ ([|E.text (T.pack tagFieldName)|] <:> encStr opts conName) <%>
440− ([|E.builder contentsFieldName|] <:> fexp)
440+ ([|E.text (T.pack contentsFieldName)|] <:> fexp)
441 ObjectWithSingleField ->
441 ObjectWithSingleField ->
442 object (encStr opts conName <:> fexp)
442 object (encStr opts conName <:> fexp)
@@ -500,7 +500,8 @@ argsToEncoding opts multiCons (RecC conName ts) = case (unwrapUnaryRecords opts,
500 toPair (arg, (field, _, _)) =
500 toPair (arg, (field, _, _)) =
501 toFieldName field <:> [|E.builder|] `appE` varE arg
501 toFieldName field <:> [|E.builder|] `appE` varE arg
503+ toFieldName field = [|E.text|] `appE`
503− toFieldName field = [|E.builder|] `appE` fieldLabelExp opts field
504+ ([|T.pack|] `appE` fieldLabelExp opts field)
505 match (conP conName $ map varP args)
506 match (conP conName $ map varP args)
506 ( normalB
507 ( normalB
@@ -509,7 +510,8 @@ argsToEncoding opts multiCons (RecC conName ts) = case (unwrapUnaryRecords opts,
509 TwoElemArray -> array $
510 TwoElemArray -> array $
510 encStr opts conName <%> [|fromEncoding|] `appE` exp
511 encStr opts conName <%> [|fromEncoding|] `appE` exp
511 TaggedObject{tagFieldName} -> object $
512 TaggedObject{tagFieldName} -> object $
513+ ([|E.text (T.pack tagFieldName)|] <:>
512− ([|E.builder tagFieldName|] <:> encStr opts conName) <%>
514+ encStr opts conName) <%>
514 ObjectWithSingleField -> object $
516 ObjectWithSingleField -> object $
515 encStr opts conName <:> [|fromEncoding|] `appE` exp
517 encStr opts conName <:> [|fromEncoding|] `appE` exp