O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Making our own types and typeclasses

Jose Luis Vega Espanhol

Conteúdo do mapa

Making our own types and typeclasses

  1. Record Syntaxis

    • Make datatypes more easy to read
      • It´s declarated as as it was an "list"
        • data <name> = <name> {FirstParameter :: <type>, second :: <type> , ...} deriving { ... }
          • Haskell automatically creates the functions for firstparameter and the others
  2. Type Parameters

    • Nothing Just
    • Maybe
    • Type constructor takes a type to produce a new type
      • is useful when the type stored doesn't really mater too much
        • At the end the functions will be defined for an specific type
  3. Type Synonymus

    • Gives types different names so that they make more sense to someone reading our code and documentation
    • Word type defines a synonym for an existing type
    • Either : Tell us about fails
    • Deescribe what some existing type represents ir our functions
  4. Recursive Data Structures

    • One value of some type contains values of that type
      • Conatin more values of the same types
    • Make types that have themselves as type in their fields
  5. Algebraic data types

    • Data keyword define a type
      • Boolean comparisons
    • Value constructor are functions
      • deriving(show)
    • Export the functions and type
      • Modules
  6. derived instaces

    • Haskell will see if the value constructors match
    • Show and read type classes are for things that can be converted to or from strings

Informações

Descrição
Mapa Mental sobre Making our own types and typeclasses, criado por Jose Luis Vega em 17-09-2018.
Criado por
Jose Luis Vega
Visualizações
0
Avaliação

Mais sobre Data Types and Typeclasses

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?