GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

Making Our Own Types and Typeclasses

JUAN SEBASTIÁN JIMÉNEZ NIETO Spanisch

Inhalt der Mindmap

Making Our Own Types and Typeclasses

  1. Algebraic data types intro

    • data types
      • Bool
      • Int
      • Char
      • Maybe
  2. Record syntax

    • Store information
      • data values
    • Getters and Setters
    • Status function
  3. 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.
  4. Derived instances

    • Typeclasses 101
      • typeclass
        • sort of an interface that defines some behavior
    • functions defined by the typeclasses
    • typeclasses
      • Eq
      • Ord
      • Enum
      • Bounded
      • Show
      • Read
      • just
  5. Type synonyms

    • types are equivalent and interchangeable
    • giving some types different
    • distinction between type constructors and value constructors
      • Either
      • Maybe
      • Nothing
  6. Recursive data structures

    • constructors have fields that are of the same type
      • recursive data types
    • constructor
      • cons
    • define functions as operators
  7. 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
  8. A yes-no typeclass

    • strictly using Bool
    • boolean semantics works
      • tells us for sure if it's true or not
    • takes one value
  9. The Functor typeclass

    • things that can be mapped over
    • fmap
      • can hold
        • Int
        • Char
        • Bool
    • works only on lists
    • is just map
    • Types that can act like a box can be functors
  10. 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.
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck