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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Function composition

A

Using dots for multiple functions i.e.

concat . map f

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly