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

Mind map

Making Our Own Types and Typeclasses

ESGUERRA TAVERA CARLOS JOSE Spanish

Map content

Making Our Own Types and Typeclasses

  1. Algebraic data types intro

    • module
      • functions between commas
      • ending with,where
  2. Record syntax

    • Create a data type that decribes something and stores it
      • example
        • information of a person(name,lastname,age,gender,etc)
  3. Type parameters

    • A value constructor can take some values parameters and then produce a new value
    • type constructors can take types as parameters to produce new types
  4. Derived instances

    • Derive other functions to use in a data type
  5. Type synonyms

    • types that are equivalent
      • Example
        • type Phone=String then Phone and String are the same
  6. Recursive data structures

    • we can make types whose constructors have fields that are of the same type! Using that, we can create recursive data types, where one value of some type contains values of that type, which in turn contain more values of the same type and so on
  7. Typeclasses 102

    • typeclasses are like interfaces. A typeclass defines some behavior (like comparing for equality, comparing for ordering, enumeration) and then types that can behave in that way are made instances of that typeclass
    • yes-no Typeclasses
      • It is similar to the if,else conditionals in java

Information

Description
Mind Map on Making Our Own Types and Typeclasses, created by ESGUERRA TAVERA CARLOS JOSE on 20/09/2019.
Created by
ESGUERRA TAVERA CARLOS JOSE · Sep 2019
Updated
Sep 20, 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?