Bow 0.7.0 is now available
We started the year by releasing an early version of Bow, our library for Functional Programming in Swift. That initial version was a port of what our colleagues were developing in Arrow for Kotlin. It was a nice start, but it had an important issue: it wasn’t leveraging the unique features of Swift. Kotlin and Swift have many features in common; indeed, their syntax is very similar, but there are subtle details that differentiate them, and using such features, we redesigned the way we were emulating Higher Kinded Types.
This resulted in a tremendous usability improvement for the core module of the library, and marked the release of version 0.4.0. Building on this groundwork, we created a versatile module for Optics in version 0.5.0 and a powerful module for Effects in version 0.6.0, which all provide a toolset for creating software in an FP manner. We have been using the library in several projects, such as nef, with successful outcomes.
From our own usage, we have discovered small enhancements that would improve the library. Today, we are releasing version 0.7.0, which mainly includes these improvements:
Retrying and repeating effects
An important change we included in this release is the ability to retry and repeat effects with different scheduling policies that are highly composable. This feature is inspired by the work done in the effects library ZIO for Scala. It is a feature that is particularly useful, for instance, for retrying failing network requests.
For example, repeating a network request using an exponential backoff algorithm with a base time of 250 milliseconds, at most 10 times, until it succeeds, is as easy as:
The library provides numerous parameterized base scheduling policies, as well as functional combinators to make very complex policies in a seamless, easy manner.
The other most important additions to this release of the library are the contributions of several developers who participated in the Hacktoberfest. Hacktoberfest is a yearly initiative during the month of October to promote contributions to open source projects. We added a few issues for newcomers to add their first lines to Bow, and we were glad to see several nice contributions!
This marks the fifth release of the library this year. We are very proud of how the library is growing and becoming more and more mature, especially in an ecosystem like Swift, where additions like SwiftUI and Combine prepare the groundwork to make FP become more mainstream. We are looking forward to making the most out of Bow, and we are eager to show you what we have been building using it!
Please check out the following Bow resources. Comments and questions are welcome and encouraged!
Bow is proudly sponsored by 47 Degrees, a Functional Programming consultancy with a focus on the Scala, Kotlin, and Swift Programming languages which supports the active development of Bow.