Yes I am suggesting making that sort of stuff but even further make it a language feature (I know purists prefer fewer language features which is OK). I feel it is a bit early in its journey but mint is a good example:
https://mint-lang.com/
It is made by someone coming from the Elm community, who made a lot of Elm packages.