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

Mapa mental

Making (types)classes

Diego Alvarez Inglês

Conteúdo do mapa

Making (types)classes

  1. wanna a new type?

    • data datatype_name = <value constructors>
      • value constructors specify the different values that this type can have.
    • that could be printed in the prompt?
      • data datatype_name = <value constructors> deriving (Show)
  2. want to create a function to get separate info from a type?

    • example: firstName of a Person
      • firstName&nbsp;::&nbsp;Person&nbsp;-&gt;&nbsp;String firstName&nbsp;(Person&nbsp;firstname&nbsp;_&nbsp;_&nbsp;_&nbsp;_&nbsp;_)&nbsp;=&nbsp;firstname
  3. Type parameters

    • A value constructor can take some values parameters and then produce a new value
  4. type constructors

    • can take types as parameters to produce new types
  5. Derived instances

    • 1. make our data type
      • 2.think about what it can act like
  6. Type synonims

    • types equivalent and interchangeable
      • usign type keyword
        • type String = [Char]
  7. Functors

    • typeclass
      • for things that can be mapped over

Informações

Descrição
Mapa Mental sobre Making (types)classes, criado por Diego Alvarez em 14-04-2018.
Criado por
Diego Alvarez · abr 2018
Atualizado
14 abr 2018
Visualizações
2
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que a gente deve adicionar?