This is a hot topic in this book
In short, you invert the control by passing a function to a function. For example, if you are sorting a list of Book values, you can:
where sortFunction is a function that takes a Book and returns it's "rating". sortBy doesn't know what the sortFunction does, it just uses it.