Clarified function and bifunction types and refactored reduce