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

Mind map

Modules

sixto alberto becerra reslen Spanish

Map content

Modules

  1. are a collection of related functions, types and typeclasses

    • in the same way, a Haskell program is a collection of modules.
  2. There's a module for manipulating lists, a module for concurrent programming, a module for dealing with complex numbers, etc

  3. The syntax for importing modules in a Haskell script is: import <module name>.

    • Data.List
      • It provides some very useful functions for dealing with list.
        • intersperse, intercalate, transpose, concat, elemIndex ...
          • function we could find once we import Data.List
    • Data.Char
      • functions that deal with characters. It's also helpful when filtering and mapping over strings because they're just lists of characters
        • isControl, isSpace, isLower, isUpper, isAlpha, isAlphaNum, isDigit ...
          • function we could find once we import Data.Char
    • Data.Map
      • are lists that are used to store key-value pairs where ordering doesn't matter.
        • fromList , empty, insert , null, size, singleton, lookup ...
          • function we could find once we import Data.Map
    • sometimes function shared common functions
      • to solve this we make the import qualified asigning a alias for each function
        • import qualified Geometry.Sphere as Sphere
  4. Making our own modules

    • At the beginning of a module, we specify the module name
    • Then, we specify the functions that it exports
      • suroounded by () and each function separated by ,
    • after that, we can start writing the functions
      • after where definition.

Information

Description
Mind Map on Modules, created by sixto alberto becerra reslen on 27/03/2020.
Views
1
Rating

More on Haskell Modules and Libraries

Feedback

What is it about?

What do you think of the new look?

How do you like it?