Even if you manage to compare types at compile time, nothing prevents structserializing like Json::I64. Implementation Serializecan be any! I can come up with some partial solutions:
Check execution
, , Json::Object . , , . , , .
:
trait SerializeAsObject : Serialize {}
, , , . i64, .
:
, , , , , . , , , ( Idris, ).
, . , . , , , Serialize .
, , ! , , , , , , , , .