Functional Florishes Flashcards
1
Q
What is n-reduction?
A
fx = gx f = g
i.e. sumOf2 xs = foldr plus 0 xs
sumOf2 = foldr plus 0
2
Q
Function composition
A
Using dots for multiple functions i.e.
concat . map f
3
Q
Partial Application
A
A function with multiple arguments converted to succession of functions that take a single argument, currying.
plus a b = a + b
inc ‘xs’ = plus 1 ‘xs’