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

Mindmap

Chapter 7: Modules

DANIELA ABALLAY GARCIA Spanisch

Inhalt der Mindmap

Chapter 7: Modules

  1. Data.List

    • The Prelude module exports some functions from Data.List for convenience
    • It provides some very useful functions for dealing with lists.
    • You don't have to import Data.List via a qualified import because it doesn't clash with any Prelude names
  2. Load Moduies

    • You can choose to import all the module or only some functions
    • Import quialified allows you to differantiate functions with the same name putting the module name before the funciton
    • All the functions that the module exports become available in the global namespace
    • The syntax for importing modules is import <import module name>
  3. Data.Char

    • It exports functions that deal with characters
    • It's also helpful when filtering and mapping over strings because they're just lists of characters
  4. Data.Map

    • Association lists (also called dictionaries) are lists that are used to store key-value pairs where ordering doesn't matter
    • Offers association lists that are much faster (because they're internally implemented with trees) and also it provides a lot of utility functions
    • exports functions that clash with the Prelude and Data.List ones, we'll do a qualified import.
  5. Dta.Set

    • They're internally implemented with trees
    • All the elements in a set are unique
    • clash with a lot of Prelude and Data.List names, we do a qualified import.
    • The most common operation when dealing with sets are inserting into a set, checking for membership and converting a set to a list
  6. Making our own modules

    • The name of the file .hs needs to be the name of the module
    • After creating the file we need to specify the functions that it exports
    • After specifing the funtions we put a where and define the functions
    • export only those functions that act as a sort of interface to our module so that the implementation is hidden
    • Ffunctions that serve some common purpose you can put them in their own module.

Informationen

Beschreibung
Mindmap am Chapter 7: Modules, erstellt von DANIELA ABALLAY GARCIA am 29/03/2022.
Aufrufe
0
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck