Mindmap
Making Our Own Types and Typeclasses
Inhalt der Mindmap
Making Our Own Types and Typeclasses
Algebraic data types intro
- data types
- Bool
- Int
- Char
- Maybe
- data types
Record syntax
- Store information
- data values
- Getters and Setters
- Status function
- Store information
Type parameters
- constructor
- values parameters
- produce new values
- Values can arrays
- Parameters containin more data
- parameterized data
- in Haskell to never add typeclass constraints in data declarations.
- constructor
Derived instances
- Typeclasses 101
- typeclass
- sort of an interface that defines some behavior
- typeclass
- functions defined by the typeclasses
- typeclasses
- Eq
- Ord
- Enum
- Bounded
- Show
- Read
- just
- Typeclasses 101
Type synonyms
- types are equivalent and interchangeable
- giving some types different
- distinction between type constructors and value constructors
- Either
- Maybe
- Nothing
Recursive data structures
- constructors have fields that are of the same type
- recursive data types
- constructor
- cons
- define functions as operators
- constructors have fields that are of the same type
Typeclasses 102
- our own typeclasses
- types instances of our typeclasses
- cicles
- for
- where
- Eq
- instance keyword.
- defining new typeclasses and instance
- subclasses of other typeclasses
A yes-no typeclass
- strictly using Bool
- boolean semantics works
- tells us for sure if it's true or not
- takes one value
The Functor typeclass
- things that can be mapped over
- fmap
- can hold
- Int
- Char
- Bool
- can hold
- works only on lists
- is just map
- Types that can act like a box can be functors
Kinds and some type-foo
- types are applied to type constructors
- kinds
- little labels
- mapped the f over the first field
Informationen
- Beschreibung
- Mindmap am Making Our Own Types and Typeclasses, erstellt von JUAN SEBASTIÁN JIMÉNEZ NIETO am 23/09/2018.
- Erstellt von
- JUAN SEBASTIÁN JIMÉNEZ NIETO
- Aufrufe
- 0
- Bewertung