Functional Programming in Java

An Introduction

Created by Mark Perry, @mprry, G+, Blog, LinkedIn, GitHub, maperry78@yahoo.com.au

Introduction

  • Goal: Learn FP in Java
  • Premise: Programs from pure functions
  • Can feel strange - keep an open mind

The FP Road

  • Introduction
  • Data Structures
  • Errors without exceptions
  • Strictness and Laziness
  • Purely Functional State
  • Purely Functional Parrallelism
  • Property Based Testing
  • Parser Combinators
  • Monoids
  • Monads
  • Applicative Functors
  • External Effects and I/O
  • Local Effects and Mutable State
  • Stream Processing and Incremental I/O
  • Premise

    • Premise: Programs from pure functions
    • Using book, "Functional Programming in Scala"
    • FP is less powerful than imperative
    • Increased modularity
    • Easier to:
      • write
      • test
      • reuse
      • reason
      • scale
    • Effects aren't observed

    Imperative

    • Java standard library
    • exceptions
    • variables
    • null
    • setters
    • reflection
    • instanceof
    • void

    Summary

    • What is FP
    • Why is FP important
    • Questions - how do we:
      • write loops?
      • implement data structures?
      • deal with errors and exceptions?
      • handle input and output?
      • concurrency?

    Afterword

    Functional Programming in Scala, Chiusano and Bjarnason, Chapter 1

    Created by Mark Perry, @mprry, G+, Blog, LinkedIn, GitHub, maperry78@yahoo.com.au