GoConqr has a new look! Let us know what you think.

Mind map

Making your own data types and typeclasses

Santiago Cárdenas English

Map content

Making your own data types and typeclasses

  1. Algebraic data types

    • We can use the keyword data to make our own data types, also we can use the keyword deriving (show) to make the type part of the Show typeclass
  2. Record Sintax

    • We can create whatever object we want with an sintax that is pretty similar to the sintax of the data in the modules
  3. Type parameters

    • We can also use parameters of any type in the construction of any object, using all the previous concepts we can create an even more generic object.
  4. Derived instances

    • Derived instances are like addons that can be added to our objects, so they can be some sort of things, like for example if we derive Eq we can compare, if we derive Show we can print, etc...
  5. Typeclasses

    • We can create our own typleclasses using the keyword class and creating our own rules for the typeclass
  6. Functor Typeclass

    • The functor typeclass can be used like the map function, but in this case the list can have any type of data, and the function will be applied in the corresponding data type that can be applied.

Information

Description
Mind Map on Making your own data types and typeclasses, created by Santiago Cárdenas on 27/03/2019.
Views
0
Rating

More on Data Types and Typeclasses

Feedback

What is it about?

What do you think of the new look?

How do you like it?