Scala types articles

Type specialization in Scala

When I was analyzing one of Apache Spark GraphX functions for the first time I faced a class annotated with @specialized annotation. Since then I decided to find more information about it and share them with you in this post.

Continue Reading β†’

Scala rich data types

Have you ever wondered why in Scala we can directly reverse a String and in Java we must use a StringBuilder especially for it? If yes, this post provides a little bit more explanation by focusing on Scala's data types equivalents to Java's primitives (+ String) called rich wrappers.

Continue Reading β†’

Self-types in Scala

The series about Scala types system continues. After last week's article about path-dependent types, it's time to discover another type-related feature - self-types.

Continue Reading β†’

Path-dependent types in Scala

Before I went to Scala I had never imagined that we could do such many things nothing but with a types system. Aside of higher-kinded types or type boundaries that we can easily find in other languages, Scala offers more advanced type features as path-dependent types covered below.

Continue Reading β†’

Structural types

Duck typing and Scala aren't the words going well together. However with a special kind of types we can achieve similar effect that in dynamically typed languages.

Continue Reading β†’

Higher-kinded types in Scala

Types and type-safety in Scala have a special privileged place. But this wide range of techniques to deal with them makes the language discovery more difficult. And at first glance one of difficult type-related concepts are higher-kinded types, covered in this post.

Continue Reading β†’

Existential types

Scala has a rich types ecosystem with sometimes almost philosophical categories. One of such categories is the one of existential types.

Continue Reading β†’

Types variance in Scala

Lower and upper bounds are not a single Scala feature related to the types. Another one is the variance.

Continue Reading β†’

Scala type bounds

Scala has a rich type system and one of interesting features are type bounds.

Continue Reading β†’

Scala context bound

This post begins the series of posts about Scala's features called "One Scala feature per week". Every week one particular Scala's functionality will be covered. This beginning post will explain context bound.

Continue Reading β†’