I bet that something similar to the http://www.it.uu.se/research/group/hipe/papers/succ_types.pd... success typing used in erlang's dialyzer could be used to provide some level of type checking. Type hinting would only make this simpler (and with a strong contract).