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

Mind map

Haskell

ALVARO ANTONIO STAGG RAMIREZ English

Haskell

Map content

Haskell

  1. Is based on LISP programming language

    • Its research was started at 1990 as a committee-designed language
      • The first version was released at 1998 as Haskell 98
  2. The first and most important compiler is Glasgow Haskell Compiler

    • You can download it and start learning for free
    • It comes with an interactive environment (GHCi)
      • And with a project build tool (Cabal)
        • And a dependency manager
      • Enter it using "ghci" command
        • Exit using the ":q" command
        • If you see
          • Prelude>
            • Means only Haskell standard library is loaded
          • *Main>
            • A project is compiled and loaded
  3. The Hello World Program

    • main = putStrLn "Hello, World"
      • The "putStrLn" function receives a String as argument and print it out to the standard output followed by a new line (\n)
  4. The Syntax

    • Program entry point does not have arguments (like C)
    • Functions
      • functionName arg1 arg2 = code
      • Function and argument names must start with lowercase letter
    • Comments
      • Instead of "//" we use "--"
    • User defined types
      • type String = [Char]
      • Whenever the compiler sees String as a type, it replaces with with [Char]
      • Completely new data type
        • data Color = Red | Green | Blue
        • Kinda Java enums
    • if statement
      • Guards
        • Kinda multi-way if statements (else if)
    • Lists
      • Generate lists using [X..Y]
  5. Types

    • Numeric (Num)
      • Integer
      • Floating
      • Double
    • Compiler has type inference
    • List
      • String
    • Char
    • Boolean
    • Tuple
    • Typeclasses
      • Like Java interfaces
      • All types must start with uppercase letter
      • You can define new typeclasses
      • Allow us to attach a set of functions to a data type
      • Monad is a typeclass
  6. Allows cleaner and shorter implementations

    • binary functions to inline functions
      • Enclose them between backticks (`)
        • a `mod` b
    • The Maybe type
      • Returns None or a value
        • Forces programmer to handle both escenarios
  7. Create a project

    • stack new test
      • Creates a new project called "test"
        • Run it with "stack exec"
  8. Conclusion

    • Haskell has a lot of features
      • Cannot cover them all here

Images and files in the map

  • Haskell

Information

Description
Mind Map on Haskell, created by ALVARO ANTONIO STAGG RAMIREZ on 08/25/2021.
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?