Previously, trying to encode any tuples with a single value inside
causes a badarg to be raised, as it's being interpreted as an
"object", which is expected to be a list of pairs instead.
Other tuples are already let fall through to the unknown value head,
which calls the map_unknown_value callback, if provided.
This change makes it so that single-value tuples (singleton tuples) are
also let fall through, so that they can be handled by the callback, so
that they become the caller's responsibility to encode.
Previously, trying to encode any tuples with a single value inside causes a
badarg
to be raised, as it's being interpreted as an "object", which is expected to be a list of pairs instead.Other tuples are already let fall through to the unknown value head, which calls the
map_unknown_value
callback, if provided.This change makes it so that single-value tuples (singleton tuples) are also let fall through, so that they can be handled by the callback, so that they become the caller's responsibility to encode.