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

Mapa mental

Making Our Own Types and Typeclasses

Nicolas Rubiano Inglés

Contenido del mapa

Making Our Own Types and Typeclasses

  1. Algebraic data types intro

  2. Record syntax

    • This topic refers to how to define structures in Haskell
      • data Person = Person { firstName :: String , lastName :: String , age :: Int , height :: Float , phoneNumber :: String , flavor :: String } deriving (Show)
  3. Type parameters

    • We can generate new types using type constructors.
      • data Maybe a = Nothing | Just a
  4. Derived instances

    • We can add behaviour to our structures, like other typeclasses.
      • data Person = Person { firstName :: String , lastName :: String , age :: Int } deriving (Eq)
  5. Type synonyms

    • As the name says we can add synonyms to some types to make more readable, depending the code context.
      • type String = [Char]
  6. Typeclasses 102

  7. A yes-no typeclass

    • could be a function that defines

Información

Descripción
Mapa Mental sobre Making Our Own Types and Typeclasses, creado por Nicolas Rubiano el 22/09/2018.
Creado por
Nicolas Rubiano
Visitas
0
Valoración

Más sobre Data Types and Typeclasses

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué deberíamos añadir?