

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Benefits of functional programming: - ANS- The problem requirements may better be defined through functional programming than by procedural
Fold function - ANSa method that reduces a list to a single element by using a function on all elements Foldl vs foldr - ANSfoldl (-) 0 [2,3,4] à ((0 - 2) - 3) - 4 = - foldr (-) 0 [2,3,4] = 2 - (3 - (4 - 0)) = 3 FoldL starts with the left most while FoldR starts with the right. Function application - ANSThe process of calculating the result of a function by passing it data to produce a result Function type - ANSRefers to the way in which a function is: input_type à output_type Functional composition - ANSCombining two or more functions together to create more complex functions Functional programming paradigm - ANSA language where each line of code is made up of calls to a function, which in turn may be made up of other functions, or result in a value Head - ANSThe first element of a list Higher order function - ANSA function that takes another function as ain input e.g. map function can take the + function as an input, or returns a function as a result Immutability of God - ANSThe idea that in functional programming that values cannot be overwritten or changed once they are already assigned Map function - ANSThe map function applies a function to all values on a list.