defining functions Flashcards

1
Q

curried functions

A

functions with multiple arguments that return functions as a result

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

what is the benefit of curried functions

A

create simpler functions via partial application

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

lambda expression

A

functions without a name

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

what are the 2 benefits of lambda functions

A

helps explain currying
dont have to name functions that are only called once

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

operator sections

A

putting the operation before the two arguments creating a curried function

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

either function

A

returns either of two types

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

maybe function

A

returns nothing or just

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

why do we use either and maybe functions

A

some programs may fail so these allow you to at least return something useful

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

total functions

A

defined for all possible functions of its type
always terminates

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

how can we turn a partial function into a total one

A

using either or maybe

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

partial function

A

only defined for some of the functions of its type

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