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

Mapa mental

Making Our Own Types and Typeclasses

Nicolas Medina Inglés

Making Our Own Types and Typeclasses

Contenido del mapa

Making Our Own Types and Typeclasses

  1. To define a new data type we use the word data

    • The part before the = is the Type and after the = are the value constructors: specify the values that the type can have
      • we can optionally add some types after it and those types define the values it will contain.
        • if there's only one value constructor, we can use the same name for the data type and the value constructor
          • We can export our data types. we just have to write it in the module declaration.
            • In parentheses, we specify the value constructor.
              • To add everything just put ( .. ) inside the parentheses.
  2. RECORD SYNTAX

    • It’s an alternative to write data types.
      • We write the field types, and then write double colon :: to specify the type
  3. Derived instances

    • Haskell can derive the behavior of these types to our data types.
  4. Type synonyms

    • Give different names to the type data so that they make more sense to someone reading our code and documentation.
  5. Recursive data structures

    • where one value of some type contains values of that type, which in turn contain more values of the same type and so on.
  6. Binary search tree

    • An element points to two elements, one on its left and one on its right. The element to the left is smaller, the element to the right is bigger.

Imágenes y archivos del mapa

  • Making Our Own Types and Typeclasses
  • Making Our Own Types and Typeclasses
  • Making Our Own Types and Typeclasses
  • Making Our Own Types and Typeclasses
  • Making Our Own Types and Typeclasses
  • Making Our Own Types and Typeclasses
  • Making Our Own Types and Typeclasses
  • Making Our Own Types and Typeclasses

Información

Descripción
Mapa Mental sobre Making Our Own Types and Typeclasses, creado por Nicolas Medina el 19/09/2018.
Creado por
Nicolas Medina
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?