back

by layer8·6y ago·view on hn ↗
Actually, my aim was to give a broader perspective and draw attention to the fact that the inference rules as presented in the article are not limited to constructors, but can apply to any function. Thinking in those terms, you want to give functions a return type that matches the guarantees you want the function to give the caller (and argument types that match the guarantees the caller should give to the function). Furthermore, it means that using types in terms of a deductive system is not restricted to languages with ML/Haskell-like data constructors, but generally useful in any statically-typed language that supports user-defined types.