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

Mapa mental

Custom Types and Typeclasses

ALVARO ANTONIO STAGG RAMIREZ Inglés

Contenido del mapa

Custom Types and Typeclasses

  1. Can be defined with the "data" keyword

  2. Can implement other typeclasses traits

    • Use de "deriving" keyword
  3. Can be exported

    • Add "(..)" if wanna export all value constructors
  4. Named data attributes

    • "Record Syntax"
  5. Type parameters

    • "data MyType p = ..."
  6. Derived Instances

    • Can create Enums
    • Kinda "extends"
  7. Type Synonyms

    • String = [Char]
    • "type String = [Char]"
  8. Can be recusirve

    • "data MyType a = Empty | Cons (MyType a)"
  9. Fixity declarations

    • Make functions infix by default
      • "infix <fixity> <FuncName>"
  10. Typeclass behaviour

    • defining functions without implementation
    • Define a new Typeclass
      • "class <Name> <Generic> where"
      • Create implementation for data using "instance"
        • "instance <Typeclass> <OurType> where"
    • Can be subclasses
  11. Functor Typeclass

    • Generic interface for applying functions to values in a container or context.

Información

Descripción
Mapa Mental sobre Custom Types and Typeclasses, creado por ALVARO ANTONIO STAGG RAMIREZ el 06/10/2021.
Visitas
1
Valoración

Más sobre Data Types and Typeclasses

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué deberíamos añadir?