crates/polars-arrow/src/scalar/README.md
Design choices:
Scalar is trait objectThere are three reasons:
enum is backward-incompatibleScalar MUST contain nullability informationThis is to be aligned with the general notion of arrow's Array.
This API is a companion to the Array, and follows the same design as Array. Specifically, a
Scalar is a trait object that can be downcasted to concrete implementations.
Like Array, Scalar implements
dtype, which is used to perform the correct downcastis_valid, to tell whether the scalar is null or notmatch that users need to write