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

Mind map

Syntax in Functions

CASTILLO ZAMBRANO LUIS FELIPE Spanish

Syntax in Functions

Map content

Syntax in Functions

  1. Pattern matching

    • when creating a function, the body can separate into patterns
    • You can pattern match on any data type
    • unordered sentences in patterns might generate infinite loops
      • we should always include a general pattern
        • _ any data from the list
    • you have to define the patterns for whatever entrance
  2. The lists themselves can also use patterns.

  3. Guards, guards!

    • The guards are a way to check if any property of a value (or several of them) is true or false.
    • the patterns are usually used with the guards
      • if all the guards of a pattern are executed and they are false, we continue with the following pattern
    • they follow the name of a function and its parameters
    • has a little bleeding to the right and aligned
    • A guard is basically a Boolean expression
      • it is discouraged to write guards online are not very readable
  4. where is located after the guards to calculate a varibale and then that variable compare it using the guards

    • it is best to apply sangria
    • The names that we define in this section are only visible for that function
    • the variables must be aligned correctly
    • If you want multiple patterns of a function to access a shared name, you must define it globally.
  5. Where bindings are a syntactic construct that let you bind to variables at the end of a function and the whole function can see them, including all the guards.

    • The names that you define in the let part are accessible to the expression after the in part
    • If we want to link several variables online, obviously we can not align them in columns That's why we can separate them with semicolons.
  6. Case expressions

Images and files in the map

  • Syntax in Functions
  • Syntax in Functions
  • Syntax in Functions
  • Syntax in Functions

Information

Description
Mind Map on Syntax in Functions, created by CASTILLO ZAMBRANO LUIS FELIPE on 15/02/2018.
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?