Ayúdanos a dar forma a GoConqr. ¿Qué deberíamos añadir?

Mapa mental

Chapter 8: Making Our Own Types and Typeclasses

MARIA GABRIELA MEJIA TRUJILLO Español

Chapter 8: Making Our Own Types and Typeclasses

Contenido del mapa

Chapter 8: Making Our Own Types and Typeclasses

  1. Algebraic data types

    • Define new data types
      • structure
  2. Record syntax

    • Record info of a type data with custom fields
      • 1. Write the name of the field
        • 2. "::"
          • 3. Specify the type
    • Creates functions that lookup fields in the data type
  3. Derived instances

    • Typeclass is a sort of an interface that defines some behavior.
      • Haskell can make a type an instance of:
        • Eq
        • Ord
        • Enum
        • Bounded
        • Show
        • Read
      • Keyword: Deriving
  4. Type synonyms

    • Gives some types different names to make more sense reading our code and documentation.
      • Keyword: Type
  5. Recursive data structures

    • One value of some type contains values of that type
  6. Typeclasses 102

    • Typeclasses are like interfaces
      • defines some behavior
    • Structure
      • 1. Define typeclass
        • Ex: Class Eq a where
      • 2. Define functions

Imágenes y archivos del mapa

  • Chapter 8: Making Our Own Types and Typeclasses
  • Chapter 8: Making Our Own Types and Typeclasses

Información

Descripción
Mapa Mental sobre Chapter 8: Making Our Own Types and Typeclasses, creado por MARIA GABRIELA MEJIA TRUJILLO el 07/10/2021.
Visitas
0
Valoración

Más sobre Data Types and Typeclasses

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué deberíamos añadir?