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

Mapa mental

Haskell Modules

Nicolas Rubiano Inglês

Conteúdo do mapa

Haskell Modules

  1. We need to import the modules before we can use it.

    • How?
      • Using the keyword: import MyModule
        • import Data.List
          • After import the module Data.List all the functions in that package will be available to us.
  2. Also we can import the functions needed in a module.

    • import Data.List(nub)
      • On the other way around we can hide some function from the namespace
        • import Data.List hiding nub
  3. Sometimes we can have conflicts with function form diferents modules with the same same so in tha case we need to reference it with a qualified indentifier

    • import qualified Data.Map
      • Other way to do an import is
        • import qualified Data.Map as M
          • We are using M as alias to call the function in the module Data.Map
  4. Build in Modules

    • Data.List
      • Functions related with lists.
    • Data.Char
      • Functions to deal with chars
    • Data.Map
      • Function to deal with key value pair where the order doesn't matter
    • Data.Set
      • Functions to deal with Sets, contains unique elements and they are ordered.
  5. How to define our own Modules

    • As a good practice is better to group functions related to put it in the same module.
      • module Geometry ( sphereVolume ) where
        • module Geometry ( sphereVolume ) where sphereVolume :: Float -> Float sphereVolume radius = (4.0 / 3.0) * pi * (radius ^ 3)
          • We must put the Geometry.hs in the same path of the main module in order to import it in the running module.

Informações

Descrição
Mapa Mental sobre Haskell Modules, criado por Nicolas Rubiano em 22-09-2018.
Criado por
Nicolas Rubiano
Visualizações
0
Avaliação

Mais sobre Haskell Modules and Libraries

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?