Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Fun Ruby

Fun Ruby

Functional Programming concepts in Ruby

Guilherme Carlos

July 03, 2015
Tweet

More Decks by Guilherme Carlos

Other Decks in Technology

Transcript

  1. FP in a Nutshell ➔ Anonymous Functions ➔ Higher Order

    Functions ➔ Immutability ➔ No Side-Effects
  2. ➔ Accept a function as an argument ➔ Return a

    function as the return value Higher Order Function
  3. Immutability “Much of Ruby, especially its runtime, is much closer

    to Python's [than Perl's], with the exception of Ruby's mutable strings, which I find an abomination.” - Guido van Rossum (Python creator)
  4. Pure Functions ➔ The function always evaluates the same result

    value given the same argument value ➔ Evaluation of the result does not cause any semantically observable side effect or output