good examples of functional-like python code that one can study?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/functionalprogramming

Our great sponsors
  • OPS - Build and Run Open Source Unikernels
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • jax

    Composable transformations of Python+NumPy programs: differentiate, vectorize, JIT to GPU/TPU, and more

    thinc - defining neural nets in functional way jax, a new deep learning framework puts emphasis on functions rather than tensors, I've tested it for a couple of applications and it's really cool, you can write stuff like you'd write math expressions in papers using numpy. That speeds up development significantly, and makes code much more readable

  • Coconut

    Simple, elegant, Pythonic functional programming.

    If you want to do FP style programming in Python you technically can, but it's been made to make the whole thing less pleasant and the language and community continues to reflect that. It would make more sense to try using something like Coconut, which is to Python what Scala is to Java: essentially a superset of the language that works in the same ecosystem. Or use an entirely different language like F# or OCaml, but that's a bigger jump than going from Python to Coconut.

  • OPS

    OPS - Build and Run Open Source Unikernels. Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.

  • thinc

    🔮 A refreshing functional take on deep learning, compatible with your favorite libraries

    thinc - defining neural nets in functional way jax, a new deep learning framework puts emphasis on functions rather than tensors, I've tested it for a couple of applications and it's really cool, you can write stuff like you'd write math expressions in papers using numpy. That speeds up development significantly, and makes code much more readable

  • pfun

    Functional, composable, asynchronous, type-safe Python.

    Another examples: pfun - stuff you'd find in FP language, but in Python (like using monads for effects)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts