Ajude a dar forma ao GoConqr. O que a gente deve adicionar?

Mapa mental

Custom Types and Typeclasses

ALVARO ANTONIO STAGG RAMIREZ Inglês

Conteúdo do 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.

Informações

Descrição
Mapa Mental sobre Custom Types and Typeclasses, criado por ALVARO ANTONIO STAGG RAMIREZ em 06-10-2021.
Visualizações
1
Avaliação

Mais sobre Data Types and Typeclasses

Fale Conosco

Sobre o que é sua mensagem?

O que a gente deve adicionar?