A single-file library providing functional programming utilities like map, filter, fold, and set operations for modern Fortran.
functional-fortran is a library that introduces functional programming utilities to modern Fortran, providing tools like map, filter, fold, and set operations. It enables Fortran developers to write more declarative and mathematically expressive code while minimizing mutable state and leveraging Fortran's pure function support.
Fortran programmers, especially in scientific and numerical computing, who want to incorporate functional programming patterns into their codebases for improved clarity and reduced bugs.
It offers a comprehensive, single-file implementation of functional utilities tailored to Fortran's type system, making it easy to adopt without heavy dependencies, and it encourages best practices through pure, side-effect-free operations.
Functional programming for modern Fortran
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library is a single .f90 file, allowing easy drop-in usage without complex build systems, as highlighted in the 'just drop-in the source file' section.
Offers a full set of higher-order functions like map, filter, and fold, plus set operations, enabling expressive mathematical code as shown in the examples.
Supports all standard Fortran 2008 data types, including various integer, real, complex kinds, and character strings, ensuring wide applicability.
Functions such as subscript are out-of-bounds safe, returning empty arrays instead of causing errors, promoting robust code.
Recursive functions and higher-order abstractions can be less efficient than imperative loops, which is a concern in performance-sensitive Fortran applications.
Some functions, like those for sum and product, duplicate Fortran intrinsics, adding unnecessary layers if not needed for functional style.
As a niche library for functional programming in Fortran, it has a smaller community and fewer resources compared to mainstream tools.