1/10
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Abstraction
Ignoring implementation details
Information Hiding
Hiding the complexity of programs
Purpose of abstraction
Provides an abstract view of a program; only needs to understand the abstract view to use it.
Modularity
Good approach to problem-solving to divide a problem into smaller independent problems
Functional Abstraction
Provided with:
Inputs
Outputs
Pre-conditions
Post-conditions
Don’t need to know how it works internally
Data Abstraction
Abstracts over data - does not specify how the data is implemented, nor how the functions manipulating the data are implemented
Abstract Data Type Components
An abstract type name A
An abstract interface to these operations
A concrete representation type T
Concrete implementation of operations on T
Haskell Modules
Used to define ADTs.
Module Components
Data types
Type declarations
Functions
Type signatures
Type classes
Instances of type classes
Other kinds of declarations that we have not discussed yet
Type Classes
Provides a form of abstraction:
A type class specifies an interface
Specifies a class of types abstractly
A member of that class must implement this interface
Object components
Some internal state
Methods to manipulate the state