J. Correia Lopes

FEUP/DEI & INESC TEC

User Tools

Site Tools


teach:fpro:lectures:20

T: 06/12/2018

Master in Informatics and Computing Engineering
Programming Fundamentals
Instance: 2018/2019


Lecture #20 :: 06/12/2018

Goals

By the end of this class, the student should be able to:

  • Describe the Effect-free programming style: function calls have no side effects and variables are immutable
  • Enumerate the Python language features that enables the programmer to adopt an Effect-free programming style

Content

  • Python & Functional Programming
  • 4.17.1 Modifiers vs Pure Functions
  • Iterators
  • (Avoiding) Flow Control
  • Closures and Callable Instances
  • Generators and lazy evaluation
  • Utility Higher-Order Functions

Bibliography

  • David Mertz, Functional Programming in Python, O’Reilly Media, 2015, available in PDF

Materials

  • J. Correia Lopes, Script and illustrations, 20-effect-free.pdf
  • FPRO, 2018/19, Python code, Lecture's on GitHub
  • Andrew Kuchling, Functional Programming HOWTO, Python 3.6.7 documentation, Release 3.6.7, November 20, 2018, HTML

Summary

  • Effect-free programming style. Side-effects. Closures. Generators and lazy evaluation. Higher-Order Functions.

FPRO, 2018/19

« Previous | Index | Next »

teach/fpro/lectures/20.txt · Last modified: 18/12/2018 20:23 by Correia Lopes