Types as axioms, or: playing god with static types
This was interesting but it seems to me that if you really want your type system to let you do everything you might reasonably want to do but also to catch any errors you could reasonably expect it to, you not only need a concept of subtype, you need to be able to tell your compiler that a function that can handle mutilple types can return different types based on the type passed in.<p>For example, let&#x27;s say I have a square root function that will happily handle real or even complex input, and I will want to pass it&#x27;s output to another function that only accepts real input. Maybe I&#x27;m asking too much from life, but it seems to me that I need to tell the compiler that if I pass in a nonnegative real input, I&#x27;m getting a nonnegative real output. AND I need to be able to assure my compiler the number I&#x27;m passing in is a nonnegative real.