What are higher order functions in functional programming? How does the 'map' function work and why is it a higher order function?

Higher order functions either have one or more arguments that are themselves functions, return a function as their result, or both. Arguments to higher order functions can themselves be higher order functions, though this is not a requirement. 
The ‘map’ function requires both a function and a list be passed as arguments. Since it requires a function as argument, 'map' must be a higher order function. The function that is passed as an argument is applied to every element of the list (using each element as the argument of the passed function), to form a new list of results. The resulting list will have the same length but may have a different type to the initial list, depending on the function used as argument.

Answered by Joseph C. Computing tutor

1636 Views

See similar Computing A Level tutors

Related Computing A Level answers

All answers ▸

Basic Conversions (Binary, Hexadecimal, etc)


A computer stores floating point numbers of size 1 byte, with 3 bits for the mantissa and 5 bits for the exponent. State what the effects would be on the stored numbers if instead 5 bits were used for the mantissa and 3 bits were used for the exponent.


Write a function in pseudocode that determines if a given string is a palindrome


How does a HDD (Hard drive disk) work?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences