One small step for me, and I don’t know if it will help mankind at all. But Hello, Scala is now called Scala Book, and you can find it here on scala-lang.org.
Tutorials about the Scala programming language.
Here’s an example of Union Types in Scala 3 (Dotty). This image comes from this Martin Odersky video.
I recently created a command I named
ffx that lets you search your filesystem for files that contain multiple strings or regular expressions. This post describes and demonstrates its capabilities. (There’s a little video down below if you want to see how it works before reading about it.)
I’ll write about this a little more when I’m awake, but here’s a little look at ADTs implemented in Scala 2 (with traits and case objects) and Scala 3 enums.
“I though it was obvious, but apparently it's not. FP is not about not having side effects at all, otherwise it would be useless. It's just about deferring them for as long as possible, that's all.”
~ Alessandro Lacava, in this tweet
I wanted some specific features in a “find” utility, and when I couldn’t figure out how to get them with combinations of
awk, and other Unix commands, I wrote what I wanted in Scala. Those features are (a) showing matching filenames, (b) showing the line that matches my search pattern, and underlining the pattern in the output, (c) showing the line numbers of the matches, and (d) showing an optional number of lines from the file before and after each match.
Back when I was writing Functional Programming, Simplified I started to write a little Scala/FP “To-Do List” application that you can run from the command line, based on a similar application in the Learn You A Haskell For Great Good book. For reasons I don’t remember, I decided not to include it in the book, and forgot about it until I started using GraalVM (“Graal”) recently.