Chapter 9: More about Higher Order Functions (part 2)

Comments

maxPlusOne can be defined points-free as

maxPlusOne = ((+1) .) . max

But I'll leave it to you to decide whether you think that's clearer. (I think it can be once you get used to it. The general pattern applies whenever you want to compose a function with another one that takes more than one argument.)

Oh, thanks - I was sure there would be a way but it wasn't obvious how to get to it, I'll have a look at that snippet tonight!

Post a comment

Already a Vox member? Sign in