Functional Programming in Ruby

Functional Programming in Ruby

koen handekyn
This is a sample of the book's content.Buy on Leanpub

Table of Contents

Getting Started›

  • ‘For’ considered Harmful
    • Diving in with an Example
    • Comparing Styles
    • Conclusions
    • Software and Complexity and it’s cost
    • Short History of Functional Programming
    • The world of functional programming languages
  • The Power of Recursion
    • Basic Algorithms
    • Sometimes you need assistance
    • Avoid utility functions with default argements
    • Sorting Algorithms
    • Backtracking Algorithms

Think Different›

  • Different styles of Functions in Ruby
    • Defs
    • Lambda’s
    • Short Lambda’s
    • Lambda’s as constants
  • Functional Patterns in Standard Ruby
    • Functions as the Atoms of an Interface
    • Why Bang means Watch Out (Imutable)
    • Iterator and Visitor Revisited
    • No more Factory Method, Strategy, Template Method
  • Pulling your data through the blender
    • Functional processing of data: Filter-Sort-Map-Reduce
    • Group-Theory: Permutations-Combinations-Products
  • Coming back to the basic algorithms
    • Basic algorithms: rewrite
    • Exercises
Functional Programming in Ruby/Think Different/Different styles of Functions in Ruby

Different styles of Functions in Ruby

Defs

Lambda’s

Short Lambda’s

Lambda’s as constants

Previous

The Power of Recursion

Up next

Functional Patterns in Standard Ruby

In this chapter

  • Different styles of Functions in Ruby
  • Defs
  • Lambda’s
  • Short Lambda’s
  • Lambda’s as constants