Types and classes Flashcards

1
Q

What is a type?

A

A name for a collection of related values

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

What is a function type?

A

Map values of one type to values of another

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

What is a curried function?

A

Function takes multiple arguments and returns one value (of one type)

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

What is a polymorphic function

A

A function where the type is of any type

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

What is an overloaded function

A

A polymorphic function which contains a class constraint (Num , Eq, Ord)

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

What is a type interface?

A

Type is calculated at compile time

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

What is a list type?

A

A sequence of values of the same time

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

What is a tuple type?

A

A sequence of values of different types (encodes size)

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

Give some examples of polymorphic functions in standard prelude

A

head
take
zip
id
fst

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

Give some examples of overloaded functions in the standard library

A

+ (Num)
== (Eq)
< (Ord)

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