Mind map
TYPE AND TYPECLASSES - HASKELL
Map content
TYPE AND TYPECLASSES - HASKELL
Data type
- type constructor
- data nameField = value1 | value 2 | value3
Typeclasses
- we can make different types
Keywords
"data" means that we're defining a new data type
- The part before the = denotes the type
- The parts after the = are value constructors
- The | is read as or
- data Bool = False | True
Declarations of types
Functions that take the fields as parameters
- A value constructor can take some values parameters and then produce a new value.
Value constructor
- Value constructors are actually functions that ultimately return a value of a data type
Derived instances
Type synonyms
Recursive data structures
first we create our data type and then we think how it works.
- To define what it can act like we use the “deriving” keyword
Information
- Description
- Mapa Mental Capitulo 8
- Created by
- FONTALVO ROMERO EDUARDO JOSÉ · Apr 2018
- Updated
- Sep 19, 2018
- Views
- 50
- Tags
- Rating
More on Data Types and Typeclasses