Document return type for middle(x)

The special cases give the same result as the general rule, but are faster.
Fix the docs and explain the rule as regards the result type.