¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

Syntax in Functions

Diego Alvarez Informática Inglés

Contenido del mapa

Syntax in Functions

  1. Pattern matching

    • when writing functions
      • you define separate function bodies for different patterns
    • checked from top to bottom
    • First: to specify the most specific ones first
      • After: the more general ones
    • Wanna avoid crashes??
      • Include a catch-all pattern
    • Some uses
      • Tuples
      • List comprehensions
      • Lists
        • x:xs
          • x -> head
          • xs:tail
    • Using @
      • xs@(x:y:ys)
    • Patterns
      • to which some data should conform
  2. Guards

    • like IF, ELSE
      • Some property of a value is?
        • True
        • False
    • Not = after the function
  3. Where

    • Avoid repetitions of code
    • Always after guards
    • Bind to names or functions
  4. Let

    • Expressions
      • Bind to variables at the end of a function
        • More than one variable?
          • separate by ;
    • Sintaxis
      • let <bindings> in <expression>
  5. Case expressions

    • like switch-case in java
    • Similar to:
      • pattern matching on parameters in function definitions
    • Sintaxis
      • case expression of pattern -> result
        • expression is matched against the patterns.

Información

Descripción
Informática Mapa Mental sobre Syntax in Functions, creado por Diego Alvarez el 27/02/2018.
Creado por
Diego Alvarez
Visitas
1
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?