decode function looking smthing like decodePrimitives .decodeUnknown with the only difference lying in the input types not being unknown but being the primitives type of the expected output object.decodeUnknown. However sometimes it's just a matter of mapping data shapes, or mapping an external string that is expected to be a union, a literal, enum or whatever. So I am confident enough to not pass an unknown value to the decodeUnknown, yet not confident enough to use the base decode.Primitives that I use like this: