Source: https://www.mathsgenie.co.uk/resources/a-pure-functions.pdf