Could Kotlin or Swift do it? I like Python/Flask/Sqlalchemy for backend web dev, but I long for a modern, statically typed FP alternative that’s equally (or nearly as) practical and accessible. Just a pipe dream?
Kotlin doesn't belong in these discussions, no exhaustive pattern matching.
The language is not set in stone.
There is hardly anything FP about Kotlin.
Have you tried Mypy? It certainly has limitations, but it provides some static typing to Python.
I've tried mypy, but it's still too immature (creates more issues than it solves). Specifically it's buggy and very limited (IIRC support for recursive types hadn't landed and many popular libraries--like SQLAlchemy--can't be annotated or stubbed).