JCL

FEUP/DEI & INESC TEC

User Tools

Site Tools


teach:fpro:lectures:18

LE18: 17/12/2020

Master in Informatics and Computing Engineering
Programming Fundamentals
Instance: 2020/2021


Lecture #18 :: 17/12/2020

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

  • Effect-free programming style
    • Python & Functional Programming
    • 4.17.1 Modifiers vs Pure Functions
    • Iterators
    • (Avoiding) Flow Control
    • Closures and Callable Instances
    • Generator functions and lazy evaluation
    • Utility Higher-Order Functions (HOF)
    • Equivalences of comprehensions with HOF

Bibliography

  • David Mertz, Functional Programming in Python, O'Reilly Media, 2015 HTML
  • A. M. Kuchling, Functional Programming HOWTO, Python 3.7 documentation, Release 0.32 HTML

Materials

Summary

  • Effect-free programming style. Side-effects. Avoiding flow control. Closures and callables. Generator functions and lazy evaluation. Higher-Order Functions (HOF). Equivalences HOF and comprehensions.

FPRO, 2020/21

« Previous | Index | Next »

teach/fpro/lectures/18.txt · Last modified: 03/01/2021 17:43 by Correia Lopes