Mindmap
MAKING OUR OWN TYPES AND TYPECLASSES

Inhalt der Mindmap
MAKING OUR OWN TYPES AND TYPECLASSES
Algebraic data types intro
- use data keyword to define a type
- data means that we're defining a new data type.
- The part before the = denotes the type
- data means that we're defining a new data type.
- use data keyword to define a type
Record syntax
- by using record syntax to create this data type, haskell automatically made these function: firstName, lastName, age, height, phoneNumber and flavor
- we can use curly brackets instead of naming the field types one after another and separating them with spaces
Type parameters
- A value constructor can take some values parameters and then produce a new value
- type constructors can take types as parameters to produce new types
- Type parameters are useful because we can make different types with them depending on what kind of types we want contained in our data type
- type constructors can take types as parameters to produce new types
- A value constructor can take some values parameters and then produce a new value
Derived instances
- Type parameters are useful because we can make different types with them depending on what kind of types we want contained in our data type
Type synonyms
- Type synonyms just about giving some types different names
- Type synonyms can also be parameterized
Bilder und Dateien der Mindmap
Informationen
- Beschreibung
- Mindmap am MAKING OUR OWN TYPES AND TYPECLASSES, erstellt von MORA GOMEZ ANA MARIA am 19/09/2018.
- Erstellt von
- MORA GOMEZ ANA MARIA · Sep 2018
- Aktualisiert
- 23 Sep 2018
- Aufrufe
- 0
- Bewertung
Mehr zu Data Types and Typeclasses
