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

Mindmap

Chapter 8 - Making Our Own Types and Typeclasses

Jesús Henríquez Spanisch

Inhalt der Mindmap

Chapter 8 - Making Our Own Types and Typeclasses

  1. Algebraic data types intro

    • For the creation of a type is the word "data"
      • For example, the bool type is defined the following way:
        • data Bool = False | True
  2. Record syntax

    • Similar to the creation of a POO object
      • data Person = Person String String Int Float String String deriving (Show)
  3. Type parameters

    • Data builders and type they can take parameters and produce a new value.
  4. Type synonyms

    • They are a way of defining that 2 types are equal and interchangeable, for example:
      • type String = [Char]
  5. A yes-no typeclass

    • Define a function
      • This function takes a value of any kind that can express some truth value and tells us if it is true or not.
  6. Kinds and some type-foo

    • We talk about type constructors take other types as parameters and end up producing specific types
      • Like the functions that take values ​​as parameters and return value

Informationen

Beschreibung
Mindmap am Chapter 8 - Making Our Own Types and Typeclasses, erstellt von Jesús Henríquez am 23/09/2018.
Erstellt von
Jesús Henríquez
Aufrufe
0
Bewertung

Mehr zu Data Types and Typeclasses

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck