diff --git a/lambda-buffers-codegen/src/LambdaBuffers/Codegen/LamVal/Json.hs b/lambda-buffers-codegen/src/LambdaBuffers/Codegen/LamVal/Json.hs index dbcdb2bf..9744def9 100644 --- a/lambda-buffers-codegen/src/LambdaBuffers/Codegen/LamVal/Json.hs +++ b/lambda-buffers-codegen/src/LambdaBuffers/Codegen/LamVal/Json.hs @@ -265,14 +265,11 @@ toJsonRecord :: QRecord -> ValueE toJsonRecord (qtyN, recTy) = LamE ( \recVal -> - case OMap.assocs recTy of - [] -> ErrorE "Got an empty Record type to print in `toJsonRecord`" - _ -> - jsonObjRef - @ ListE - [ TupleE (fieldNameVal fieldName) (toJsonRef fieldTy @ FieldE (qtyN, fieldName) recVal) - | (fieldName, fieldTy) <- sortOn fst $ OMap.assocs recTy - ] + jsonObjRef + @ ListE + [ TupleE (fieldNameVal fieldName) (toJsonRef fieldTy @ FieldE (qtyN, fieldName) recVal) + | (fieldName, fieldTy) <- sortOn fst $ OMap.assocs recTy + ] ) {- | `fromJsonRecord ty qrec` makes a `LamVal` function for decoding record type values from their JSON representation `fromJson :: Json -> Parser `.