As discussed with @FerreolS, proposed improvements:
-
adapt_precision should only change objects that have floating-point values (e.g., in tuples), i.e. not integers.
-
By default, adapt_precision should be applicable to any structure using destructure and restructure and with the above heuristic. This could be done for instances and types as well.
Introspection (and @generated) can be used for that: the parameters of a type T are given by T.parameters while T.types yields the types of the fields.
As discussed with @FerreolS, proposed improvements:
adapt_precisionshould only change objects that have floating-point values (e.g., in tuples), i.e. not integers.By default,
adapt_precisionshould be applicable to any structure usingdestructureandrestructureand with the above heuristic. This could be done for instances and types as well.Introspection (and
@generated) can be used for that: the parameters of a typeTare given byT.parameterswhileT.typesyields the types of the fields.