Scala-digest #8 (August 18 – September 4)

Usually we open our digest with the Scala language or compiler related news, but this time there is something more important. Sam Halliday finally completed his book “Functional Programming for Mortals with Scalaz”. Despite the fact that the contents is closely related to the scalaz library, this book is one of the most important contributions into the Scala community. Most chapters can be considered as the missing scalaz documentation. Moreover, the book looks like an excellent guide for a typical std Scala FP/OOP developer into the world of real pure FP life. The practical part is really impressive. In addition to simple examples of the scalaz concepts, there is one real (a non-toy) application developed through the entire book.

In conclusion, you get 300+ pages, an excellent analysis of the scalaz typeclasses hierarchy and data types, historical references, FP terminology and slang explanations for mortals.

It doesn’t matter to which part of the Scala community you belong – reading this book is definitely useful.

During this meeting, no final decisions were made on the first pack of SIPs for Scala 3. Сommittee members summarized community reaction and their opinions.They decided to add additional information into the SIP about removing auto-application, because the original motivation was related to eta-expansion, not about rules for using empty parameter list for side-effecting methods.The most interesting discussion was about XML-literals:

There was opened “name based XML literals” Pre-SIP which on the contrary proposes to improve XML-literal support. The key idea is to use name-based translation from XML to Scala AST. This approach should allow smooth integration with any kind of third-party XML-libraries in addition to getting rid off abandoned and buggy standard scala-xml.

Mostly, scala-xml is demanded by the frontend development side. There was a good point that probably it could be a mistake to remove XML literals from Scala, while other languages do the opposite, for instance JSX and its Typescript support.

Added scala.util.chaining object that provides special syntax tap and pipe. Tap allows you to add some side-effecting function before obtaining a value. Pipe to transform a value avoiding introducing a variable binding. Unfortunately, pipe didn’t get its symbol analog (e.x |>) and its documentation says that its usage may have some overhead.

Now it’s possible to use implicitNotFound annotation right in the method parameter list, not only in class definitions.

Comparing to Scala REPL, Ammonite definitely improved the user experience. On the other hand, it works a little bit slower than std, so users can feel the difference.Alexandre Archambault decided to dive into this problem and speed it up to 4 times! Now it works faster even than std. Version with this fix is already available in a snapshot-release and used in jupyter-scala 1.0.5

The goal is to provide a general, minimalistic version of the reflection api, which would be supported not only via JVM but also by other platforms: Scala.js, Scala-Native. The library consists of only three units: annotations for marking a class that its information should be available in the runtime, a method for finding such classes by name, and a class on which you can call new Instance or a constructor with parameters. Already has support for JVM and Scala.js.

In case you didn’t know before how to extract source type from referral traffic, this library is for you. Authors have made a huge effort to typify the large number of places from where the user can get to you.

Configuring auto-publishing in the repository is not the most pleasant task developer has to do. Especially in Sonatype. This plugin along with detailed instructions for presetting can perfectly save time, allowing to set sbt + travis to the repository by the tag.

Edmund Noble published documentation for testz library. It contains a reasonable motivation part with an explanation “why testz” and what is wrong with other testing libraries. Testz has so small core codebase, that probably its size less or equal to the mentioned pitch.

Blogs and Articles

If you recently came to the world of the Scala development, it could be useful to learn about the basic rules of working with Futures. As well as, the reasons why in 2018 it makes sense to start looking at the alternatives.

A view of the modern java world by the Scala developer, with answers to the frequently asked questions like why? how to do smth better? is Scala slow? (we recommend to drop the link into a local java chat)

@nihirash should think „Be afraid of your wishes” after his promise to write on Scala a working implementation of the Lisp-like language that can be used in the project for scripting, if he gets 666 retweets. He is going to publish new articles to track down the progress. The first article is already available.