Scala: How to use startsWith tests in match/case expression
alvinalexander.com » Scala
by
3d ago
FAQ: How can I use the to match multiple possible patterns in a As shown in the following example, you can use the checks to see if a starts with the prefix (or substring) you specify, so although in these examples I use complete strings, you can also use regular expression patterns ..read more
Visit website
Free functional programming book (free PDF for Scala, Java, Kotlin, etc.)
alvinalexander.com » Scala
by
3d ago
If you’re interested in functional programming, or just want to learn more about data types, generics, pure functions, expression-oriented programming, and functional error handling, I hope this book is helpful. Learn Functional Programming The Fast Way! , is now FREE. I wrote this functional programming book for developers, and you can now download it for free here ..read more
Visit website
Scala SBT: How to “re-run with -deprecation” (or -feature)
alvinalexander.com » Scala
by
3d ago
How do I ’re-run with -deprecation’ or ’re-run with -feature’? , I get warning messages like these ..read more
Visit website
SBT/build.sbt: One percent symbol or multiple percent symbol for Java and Scala dependencies?
alvinalexander.com » Scala
by
3d ago
As a brief note today, when you’re using SBT and its build.sbt file with Scala projects, use in library dependencies when referring to Scala-specific libraries, and use only one character when referring to other JVM dependencies, like Java dependencies. Here are some examples of this syntax ..read more
Visit website
ZIO 2: How to read a file and write its output to the console
alvinalexander.com » Scala
by
3d ago
As a brief example here today, the following source code shows one way to read a file using and then print its output to the console ..read more
Visit website
ScalaJ-HTTP examples: GET, POST, handling redirects
alvinalexander.com » Scala
by
2w ago
See that page for a full list of examples, but for my own use, here are a few of them. examples, see the test files in the project, including this . That file currently shows a number of good ScalaJ-HTTP examples, including GET, POST, and redirect examples with ..read more
Visit website
Scala: How to square a number (Int, Double, Float, Long)
alvinalexander.com » Scala
by
2w ago
You can square a number in Scala in at least two different ways: , such as squaring an ..read more
Visit website
Scala: What is the Nothing data type?
alvinalexander.com » Scala
by
2w ago
Some common use cases of type looks like in the Scala type hierarchy (image courtesy of type is called a , which means it is a sub-type of every other type in the Scala type system. It is also specifically a data type that has no instances ..read more
Visit website
Scala if then else syntax (and returning a value from an if statement)
alvinalexander.com » Scala
by
3w ago
In its most basic use, the Scala if/then/else syntax is very similar to Java ..read more
Visit website
Scala: A Reverse Polish Notation (RPN) calculator written with foldLeft
alvinalexander.com » Scala
by
1M ago
You don’t have to read it all yet, but some of that discussion is shown in this image: Learn You a Haskell for Great Good! . In that chapter, the author describes a “Reverse Polish Notation” (RPN) calculator. If you ever used an old Hewlett-Packard (HP) calculator, you might know what that is. (At least that’s where I first learned about RPN ..read more
Visit website

Follow alvinalexander.com » Scala on FeedSpot

Continue with Google
Continue with Apple
OR