Explore how to iterate over collections in Scala using foreach and for comprehension.
This is the standard author on the site. Most articles are published by individual authors, with their own profiles, but when multiple people have a strong contribution, we publish collectively here.
Here's what I've written (so far):
Baeldung on Scala
- Scala Collections (34)
- Scala Basics (33)
- Functional Programming (19)
- Libraries (16)
- Scala Type System (12)
- Scala OOP (12)
- Scala Strings (11)
- Akka (11)
- Scala Core (10)
- Play Framework (8)
- Build Tools (7)
- Scala Web (5)
- Testing (4)
- Scala Syntax (4)
- Series (3)
- Scala Pattern Matching (3)
- Scala IO (3)
- Scala Exceptions (3)
- Scala Dates (3)
- Scala Concurrency (3)
- Persistence (2)
- Apache Spark (2)
- Scala Numbers (1)
A quick and practical guide to error handling in ZIO.
Learn how to do case-insensitive string comparison in Scala.
An introduction to Akka-Streams in Scala.
Learn how to test whether a Scala snippet compiles using Matchers or Assertions.
A quick and practical guide to ZIO Test.
Learn various ways to reverse a sequence in Scala.
Explore Kafka using Scala and learn how to produce and consume messages on a topic.
A quick and practical guide to appending an element to an array in Scala.
Learn about Scala Spire, a library that provides performant and generic numeric types.
Learn about the Either Type in Scala.
A quick and practical guide to creating ZIO effects.
Learn how to find the first element matching a condition in a collection.
Learn how to obtain subarrays in Scala, exploring two primary methods: the slice() function and the combination of drop() and take().
A quick and practical guide to getting difference between two dates in Scala.
Learn how to start and quit a Scala REPL session.
Learn how to convert a character to ASCII value using Scala.
Learn how to write safer scala code by using WartRemover.
A quick and practical guide to the builder pattern in Scala.
A quick and practical guide to checking if a list is another list’s sublist.
Learn how to test an Akka HTTP Application.
A quick and practical guide to rotating a Scala collection.
Learn how to use Python from within Scala with ScalaPy.
Learn about AWScala – the AWS SDK for Scala.
Scala brings a lot of functional programming concepts into the JVM. Functional programming helps to improve the software quality by making it easier to test, reuse, and reason about.
A quick and practical guide to converting byte array to string in Scala.
A quick and practical guide to the “with” keyword.
Learn how to create integration tests using Testcontainers-scala, a Scala wrapper around Testcontainers-java.
Learn how to use the pulsar4s Scala Client for Apache Pulsar
A quick and practical example of how to find the last occurrence of an element in a list in Scala.
Learn how Macros work with Scala 2
A quick and practical guide to converting Strings to camel case in Scala.
This series takes the readers through the basics of the Scala language. The readers will be able to get started with their first Scala program with the help of the articles in this series.
Learn about scala-async and how to use its async() and await() constructs.
A quick and practical guide to flattening Scala collections.
Learn about the os-lib library, which helps us manage files and processes in Scala.
Learn how to merge two maps in Scala.
Introduction to Scala’s ListMap data type.
A set of introductory and advanced articles about Scala Collections and its various methods.
A quick and practical guide to Log4j with Scala.
Learn about match types in Scala 3 are and how we can use them to implement dependent methods.
A quick and practical guide to Akka gRPC
Discover how to use forall in Scala
Get a better understanding of ListSet in Scala
A guide to Server-Sent-Events with Alpakka.
How to split a sequence using the partition, span, or groupBy functions.
A quick and practical guide to splitting a List by fixed number of elements.
Learn how to create a front-end application in Scala using the Scala.js plugin.
A quick and practical introduction to the Scala retry library.
Explore some of the basic Scala questions that could come up in a technical interview for Scala developers.
Learn the difference between Array, ArraySeq, ArrayOps, and WrappedArray in Scala
Learn the main features of the Scala language.
Learn how to count all occurrences of a given char in a String in Scala.
Learn to map both keys and values of a Scala Map.
Different ways of creating an empty array in Scala.
Learn multiple approaches for initializing an array in Scala.
Lear about arrays in Scala.
Learn various approaches for copying the elements of an array into another in Scala.
A quick and practical guide to the Magnet pattern in Scala.
Learn to remove duplicate items from a List in Scala.
Learn various ways of accessing the items of a List in Scala.
Learn various approaches for comparing Strings in Scala.
Learn how to exclude transitive dependencies when building a Scala project with SBT.
Learn how to create a simple HTTP server and client using http4s.
A quick and practical guide to converting RDD to DataFrame in Spark.
Learn about function composition in Scala.
A quick and practical String and Date conversion guide in Scala.
Learn the difference between Apache Spark’s map and flatMap functions in Scala.
Learn how to read an Akka HTTP Response body as a String.
Learn about type inference in Scala with examples.
Learn different ways to stop an actor in Akka.
Learn how to use elastic4s to work with Elasticsearch in Scala applications.
Learn about the Enumeratum library in creating improved Enumerations.
A quick and practical guide to iterating over a Map in Scala.
Learn to make simple RESTful requests with Requests-Scala.
Learn about lambda expressions in Scala.
Learn different ways to create and populate Lists in Scala.
A quick and practical guide to Scala 3’s “quiet syntax”.
Learn about the @inline and @noinline annotations in Scala.
A look at Ammonite-Ops and how to use it to perform everyday file operations.
Learn about the inline modifier in Scala 3.
Learn about Ammonite scripting with Scala.
A quick and practical guide to Given and Using in Scala.
Learn how we can define extension methods in different ways
Learn about open classes in Scala 3.
Learn how to use intersection types in Scala 3.
Learn about the multiversal equality featured introduced in Scala 3.
Learn about main methods in Scala 3.
Learn to discover Actors in Akka.
An overview of the ScalaCache library
A quick and practical introduction to Monix.
A quick and practical guide to Duration and FiniteDuration in Scala.
Learn about the implicit redesign in Scala 3.
Learn about List concatenation operators in Scala.
Learn to parse JSON with Circe.
A quick and practical guide to working with date and time in Scala.
Learn to set up a development environment for Scala using Coursier.
A quick and practical introduction to rich wrappers in Scala.
In this tutorial, we’ll see why and how to use the StringBuilder class in Scala.
A quick and practical overview of Vector’s benefits in Scala.
Learn about opaque type aliases in Scala 3.
A quick and practical overview of Play templating.
Learn to create singletons in Scala.
A quick and practical introduction to the @switch annotation in Scala.
In this tutorial, we’ll see what abstract classes and traits are in Scala and the key differences between them.
Learn to perform queries with ReactiveMongo.
Learn about implicit imports in Scala and go into more detail about the Predef package
In this tutorial, we’ll see how we can iterate through a collection while accessing the index in Scala.
Learn to schedule asynchronous tasks in Play Framework.
Learn the basics of functional programming support in Scala.
Learn about the functionalities of assert and require and their differences in semantics and exception behavior.
A quick and practical introduction to generic programming in Scala using the shapeless library
Learn to handle errors in the Play Framework using Scala.
In this tutorial, we’ll see how to create a single String from a collection of elements, and in particular, a collection of Strings.
Learn how to represent Type Disjunction or Union Types in Scala.
Learn about path-dependent types in Scala.
Learn about the Scala Cats library.
In this tutorial, we’ll see how to use the repeated parameters feature in Scala.
Learn about Alpakka in Scala.
A type alias is usually used to simplify declaration for complex types, such as parameterized types or function types. Explore examples and how they work.
Learn about Play’s caching API with Scala.
Learn about Streams, Views, and Iterators in Scala and how they differ.
A quick guide to Nil, Null, Nothing, Unit, and None in Scala.
In this tutorial, we explore the ways to find the index element in a List in Scala.
Learn to access Play configurations in Scala.
A quick and practical guide to reading environment variables in Scala.
In this tutorial, we’ll learn how to add Scaladoc to code for a Scala project.
Learn about implicit parameters in Scala.
A quick and practical guide to achieving try-with-resources semantics in Scala.
Learn how to convert Scala data types to and from a String.
A quick and practical guide to the “sealed” keyword.
Learn ‘lifting’ in Scala in different scenarios.
Learn about the Option type in Scala.
A quick and practical guide to Akka Scheduler.
Learn how to synchronously handle Futures in Scala.
Learn about foldLeft and reduceLeft in Scala.
Learn to preserve type information at runtime in Scala.
We build an example Scala REST API back end using The Play Framework. We cover the routes file and how to build simple controller functionality.
Learn about Scala’s type hierarchy
Learn how to use Slick.
Learn how to convert binary input streams into text using Scala.
A quick and practical introduction to Companion Objects in Scala.
A quick and practical overview of polymorphism in Scala.
Learn about data types in Scala.
Learn how to create a Fat JAR Using SBT.
Learn about monoids and semigroups in Scala.
A quick and practical overview of the implementation of the Pimp My Library pattern in Scala.
Have a look at several ways to configure the JVM heap size for applications built with SBT.
Learn about type casting in Scala.
A quick and practical overview of looping in Functional Programming.
Learn how implicit parameters allow us to write flexible generic code with both View and Context Bounds patterns.
Learn about access modifiers in Scala.
Learn how to set up IntelliJ with SBT for Scala development
Learn about Higher-Kinded Types in Scala and how to use them.
Learn about the Range in Scala and some of the common methods that can be applied
A quick and practical overview of various types of functions in Scala.
Learn about Strings in Scala.
Explore algebraic data types in Scala
Learn about by-value and by-name parameters in Scala.
Learn the basics of OOP and how to apply them in Scala.
Learn both the object-oriented and functional ways to handle errors in Scala
Learn about the Cake Pattern and how to implement it in Scala.
Learn the difference between the % and %% symbols in the build.sbt file.
Learn about Behavior Driven Development (BDD) testing with Scala.
Learn how to build REST APIs using Finch and Finagle
Learn how and when to use the self-type annotation in Scala.
Explore different ways to use the Scala underscore.
Learn how to implement A DSL for Writing “20 seconds” in Scala.
Learn about named and default arguments in Scala and when to use them.
A quick and practical overview of File IO in Scala.
Explore different ways of using string interpolation in Scala.
A quick and practical guide to Futures and Promises in Scala.
Learn about Scala operators.
In this tutorial learn about Typed Akka using Scala.
Learn about Scala Classes and Objects.
Mastering immutability allows us to reduce bugs caused when objects pass between functions or threads. Here we compare mutable and immutable objects in Scala.
Learn about the Play Framework with Scala.
Learn how to use the well-known Scala optics library Monocle.
A quick and practical guide to mixins in Scala.
Learn about equality in Scala.
Generics allow us to maintain type safety while writing code that can be used with a variety of types. Here we explore generic classes and functions.
Learn how to use case classes as immutable data containers in Scala and how they differ from regular classes.
A quick and practical guide to functions/methods in Scala.
Learn about the Scala’s collection library.
Learn about conditional expressions in Scala
Learn about variances in Scala.
Learn how to create, retrieve, and extend Scala’s enumeration support.
Learn both functional and imperative ways to handle exceptions in Scala
A quick and practical guide to Scala extractor objects.
Take a deep dive into Scala’s for-comprehension construct
Learn how to create and extend Scala traits.
Learn how Scala implements its lazy val feature and some problems you may encounter when using it.
Learn about partial functions in Scala.
Learn for loops from basic to advanced in Scala
Explore different methods for sorting data in Scala.
Learn all about Scala Tuples.
Learn how to use higher-order functions from the Scala standard library and how to write your own higher-order functions.
Learn about the advantages of tail recursion in Scala
Learn how to match regular expressions in Scala using the Regex class from the Scala standard library.
Learn about the core features of the Scala programming language