Use currying to improve type inference