O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Chapter 7: Modules

DANIELA ABALLAY GARCIA Espanhol

Conteúdo do mapa

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.

Informações

Descrição
Mapa Mental sobre Chapter 7: Modules, criado por DANIELA ABALLAY GARCIA em 29-03-2022.
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?