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

Mind map

Making our own types and typeclasses

Jose Luis Vega Spanish

Map content

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

Information

Description
Mind Map on Making our own types and typeclasses, created by Jose Luis Vega on 17/09/2018.
Created by
Jose Luis Vega
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?