This article describes a (loose?) analogy between physical units and data types in programming languages that I thought about while working on Insect, a scientific calculator that supports physical units.
In addition to typical mathematical operators like +, *, ^, %, etc., Insect has a special conversion operator (written as an arrow ->/➞ or as the word to). It can be used to convert an expression to a particular unit:
≫ 2 ft + 2 in ➞ cm
= 66.04 cm