GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

Making our own types and typeclasses

Jose Luis Vega Spanisch

Inhalt der Mindmap

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

Informationen

Beschreibung
Mindmap am Making our own types and typeclasses, erstellt von Jose Luis Vega am 17/09/2018.
Erstellt von
Jose Luis Vega
Aufrufe
0
Bewertung

Mehr zu Data Types and Typeclasses

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck