¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

Making our own types and typeclasses

Jose Luis Vega Español

Contenido del 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

Información

Descripción
Mapa Mental sobre Making our own types and typeclasses, creado por Jose Luis Vega el 17/09/2018.
Creado por
Jose Luis Vega
Visitas
0
Valoración

Más sobre Data Types and Typeclasses

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?