Comment on Revisiting the principles of data-oriented programmingparentComments−weavejester4ysiknad and uryga give good replies on dependent types and TypeScript's structural typing. There's also an experimental static typing system for Clojure that allows for typing of maps: (defalias NamedMap (HMap :mandatory {:first-name Str, :last-name Str})) (ann full-name [NamedMap -> Str]) (defn full-name [{:keys [first-name last-name]}] (str first-name " " last-name)) If you can determine some subset of the keys of a map at compile type, then you can type check it to some degree.
Comments
siknad and uryga give good replies on dependent types and TypeScript's structural typing. There's also an experimental static typing system for Clojure that allows for typing of maps:
If you can determine some subset of the keys of a map at compile type, then you can type check it to some degree.