Currently we export constructors for mutable vectors since they're needed for defining immutable ones and don't export constructors for immutable vector. There's two problems: 1) access to constructors is very unsafe and we expose them by default for mutable vectors 2) they're occasionally useful and we don't for immutable ones.
- For each vector data type we create
Unsafe module and define both mutable and immutable vectors there. Export both with appropriate disclaimer. This module would be a good place for unsafe conversion functions as well.
- Hide constructors for mutable vectors and provide deprecated pattern synonyms with same name for backward compatibility.
This way we can both provide access to constructor when one needs them and keep them hidden in standard scenarios.
Currently we export constructors for mutable vectors since they're needed for defining immutable ones and don't export constructors for immutable vector. There's two problems: 1) access to constructors is very unsafe and we expose them by default for mutable vectors 2) they're occasionally useful and we don't for immutable ones.
Unsafemodule and define both mutable and immutable vectors there. Export both with appropriate disclaimer. This module would be a good place for unsafe conversion functions as well.This way we can both provide access to constructor when one needs them and keep them hidden in standard scenarios.