Vlad Patryshev has been active in the Scala and Functional Programming community at the Bay Area for a while. When I was told he wrote a book on maths for programmers I was immediately interested and got my digital copy (you can get yours at gumroad.com/l/lcbk02). …

Image for post
Image for post

Nowadays functional programming has been gaining some deserved hype, and we read here and there about pure functions. However, pure functions don’t seem that useful when we face real programming issues like write into a database; connect to a server given a URL and retrieve some data from it; or listen to actions from users in a GUI. …

Image for post
Image for post

Profunctor optics remove the need for configuration objects for error handling and improve testing and maintainability; these proxies are regular functions written in the same language as the rest of the code and can be composed as any other function.

One familiar pattern when dealing with errors from an external API is to retry the operation. Some client libraries offer a way to configure the number of attempts or under which error conditions they will retry. This works most of the times, but as applications grow and corner cases become frequent, developers need granular configuration for clients. …

Optics are usually presented as data accessors for immutable data structures, and although this is very useful in functional programming it’s hardly a compelling story if you can opt for mutable structures. I present a different approach to optics as proxies for external APIs, which may help with the understanding of optics and their bigger menu of use-cases.

Lenses and other optics have been championed by functional programmers as one of the golden assets in our toolbox, but almost every time we try to convince others about the virtues of optics we face this look in their eyes like saying: “Are you serious? …

Oscar Ponce

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store