A calculator for reversed polish notation, using function composition