Unit 4 - Composite Values: Records and Tuples Flashcards

1
Q

Types of composite values

A
  • Record Types
  • Union Types
  • Collections (arrays, lists, maps)
  • Recursive types (trees, graphs)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Composite values are made up of

A

clearly identifiable components, each of which can be either primitive or composite.

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

A composite type describes a

A

family of composite values, all of which typically have a similar structure.

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

Records are

A

mappings from component names to components

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

A Java object viewed only as a collection of its attributes

A

is an example of a record.

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

Tuples are like records except that

A

their components have no names.

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

Values cannot be modified in Haskell

A

only constructed

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

Ada, Haskell provide pure records and unions with

A

good compile-time type-checking

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

C is flexible but very

A

little type-checking harms safety

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

Haskell supports the extraction of multiple components from records and unions using

A

pattern matching

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