Expression

Expression#

Expression is a practical, typed functional-programming library for Python 3.10+. It adds small, composable tools for common Python problems:

  • transform data in readable pipelines;

  • represent a value that may be absent with Option;

  • return expected failures explicitly with Result;

  • work with immutable collections and tagged unions; and

  • compose optional, fallible, and asynchronous workflows.

You do not need prior functional-programming experience. Start with Getting started, then choose a workflow in Which type should I use?.

Important

Expression complements ordinary Python; it does not require a purely functional style. Use the parts that make a workflow clearer, and keep using familiar Python types and control flow where they are the best fit.

API reference

About this documentation