types and classes Flashcards

1
Q

type

A

collections of related values

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

classes

A

collections of types that support certain overloaded methods

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

statically typed

A

types are determined at compile time

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

strongly typed

A

the type cannot be changed once assigned to a value

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

type errors

A

applying a function to arguments of the wrong type

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

what is the difference between a list and a tuple

A

tuples are finite, can be different types and cant have only one value

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

function

A

a mapping of values of one type to another

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

polymorphic functions

A

its type contains one or more type variables or can be used with different types

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

what makes a polymorphic function overloaded

A

if its type contains one or more class constraints

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

immutability

A

the value of variables cannot be changed

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

impure functions

A

you can get a different result each time as they depend on the state of the world (e.g. user input)

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

pure functions

A

with the same input youll get the same results

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

..

A

a function that generates a list of numbers based on the values either side of it

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