Scala Language

Scala Language

Deep technical articles on this topic.

140Articles
140Topics covered
Articles in this category

All 115 articles, sorted alphabetically

ARTICLE · 001

Scala 3 Given and Using: Implicits, Type Classes, Extensions

Scala 3 given instances and using clauses explained: how they replace implicits, type classes and derivation, extension methods, given imports, resolu…

Read article →
ARTICLE · 002

Scala 3 metaprogramming

Deep-dive on Scala 3 metaprogramming: inline defs and compile-time branching, typed quotes and splices, macro construction, Mirror-based structural re…

Read article →
ARTICLE · 003

Scala 3 Opaque Types: Zero-Cost Type-Safe Domain Types

Scala 3 opaque types explained: a distinct compile-time type over a primitive with no boxing, smart constructors that validate, extension methods, cod…

Read article →
ARTICLE · 004

Scala 3 Enums, in depth: the three forms, what the compiler generates, widening and variance rules, a state machine, Java interop and safe wire formats

A practical guide to Scala 3 enums: simple enumerations, parameterised enums and ADT enums, what they desugar to, ordinal, values, valueOf and fromOrd…

Read article →
ARTICLE · 005

Scala 3 Match Types, in depth: the SIP-56 reduction rules, disjointness, legal patterns, recursion, typed match expressions and debugging stuck types

Scala 3 match types from first principles: syntax and captures, the SIP-56 reduction algorithm and its four outcomes, provable disjointness, legal and…

Read article →
ARTICLE · 006

Scala 3 Stability and Roadmap: Next versus LTS, compatibility rules, the 3.9 LTS transition and an upgrade runbook

How Scala 3 versions and promises work in 2026: the Next and LTS release lines, backward-only compatibility across minor versions, the 3.9 LTS release…

Read article →
ARTICLE · 007

Scala 3 Transparent Inline, in depth: whitebox result types, expansion inside the typer, transparent givens, and the cost of refined types

What the transparent keyword changes in Scala 3 inline methods: result types taken from the expansion, why expansion runs during type checking, a work…

Read article →
ARTICLE · 008

Scala Akka Actors Introduction, in depth: building your first typed actor system step by step, from protocol to tests

A hands-on introduction to Akka typed actors in Scala: design a message protocol, keep state in behaviours, expire holds with timers, run children und…

Read article →
ARTICLE · 009

Akka Cluster architecture

Deep-dive on Akka Cluster: seed nodes, gossip convergence, phi-accrual failure detector, split brain resolver, cluster sharding, singleton, distribute…

Read article →
ARTICLE · 010

Akka HTTP on Akka Streams: Routing DSL, Backpressure, WebSockets

How Akka HTTP is built on Akka Streams: the routing directive DSL, marshalling, end-to-end backpressure, connection pools, WebSockets and SSE as Flows…

Read article →
ARTICLE · 011

Akka

Akka explained: actors and mailboxes, typed behaviors, supervision, dispatchers and the blocking trap, cluster sharding, and the BSL change that made …

Read article →
ARTICLE · 012

Akka Persistence architecture

Deep-dive on Akka Persistence: EventSourcedBehavior command/event handlers, journal plugins and sequence integrity, snapshot-bounded recovery, seriali…

Read article →
ARTICLE · 013

Akka Streams Explained: Source, Flow, Sink and Backpressure

Akka Streams in Scala: Source, Flow and Sink blueprints, materialization and operator fusion, Reactive Streams demand, async boundaries, GraphDSL, sup…

Read article →
ARTICLE · 014

Akka Typed architecture

Deep-dive on Akka Typed: sealed message protocols, Behavior[T] as functional state transitions, ActorRef[T] and compile-time mailbox safety, ActorCont…

Read article →
ARTICLE · 015

Scala Array, in depth: JVM arrays, ClassTag, ArrayOps vs ArraySeq, equality traps, IArray and writing fast array code

How Scala's Array really works: it is a JVM array, so Array[Int] is int[]; why generic code needs a ClassTag; what ArrayOps and ArraySeq wrapping…

Read article →
ARTICLE · 016

Scala Arrays and Buffers, in depth: ArrayBuffer growth, boxing, ArrayBuilder, ListBuffer aliasing and ArrayDeque

How Scala's growable sequences work and when to use each: arrays as the base layer, ArrayBuffer's backing Array[AnyRef], doubling growth and…

Read article →
ARTICLE · 017

Scala Await, in depth: Await.result versus Await.ready, timeouts, blocking and thread starvation, and where blocking on a Future is still the right call

How scala.concurrent.Await really works: result versus ready, the CanAwait permit, the completed-future fast path, Duration rules, blocking and the gl…

Read article →
ARTICLE · 018

Scala blocking, in depth: how the hint travels through BlockContext, how the global pool compensates, and where it silently does nothing

What scala.concurrent.blocking really does: BlockContext lookup order, the global pool's ManagedBlocker and maxExtraThreads semaphore, configurat…

Read article →
ARTICLE · 019

Caliban GraphQL architecture

Deep-dive on Caliban: compile-time schema derivation from Scala types, ZIO field resolvers, ZQuery automatic batching to defeat N+1, composable wrappe…

Read article →
ARTICLE · 020

Scala Case Classes

How case classes model immutable data, why they include equality, copy, and pattern matching for free, and how to design case class hierarchies.

Read article →
ARTICLE · 021

Cats Effect runtime architecture

Deep-dive on Cats Effect 3: the IO run loop, work-stealing pool with per-worker timers, IO.blocking isolation, cancellation and Poll, Resource lifecyc…

Read article →
ARTICLE · 022

Scala Cats Library, in depth

A working map of Typelevel Cats: modules, modern imports, kernel type classes, the data types worth knowing, law testing with discipline, and a worked…

Read article →
ARTICLE · 023

Scala Circe, in depth: the Json model, cursors, derivation in Scala 2 and 3, configured codecs, error accumulation and production pitfalls

A practical guide to circe, the functional JSON library for Scala: the Json AST, HCursor navigation and Decoder.Result, semiauto versus auto derivatio…

Read article →
ARTICLE · 024

Scala Closures, in depth: environments, inspecting captures, lifetime, threads, serialization, non-local return and cost

Scala closures as runtime objects: free variables and environments, how scalac and Scala 3 lift lambda bodies and capture values, reading a closure&#x…

Read article →
ARTICLE · 025

Scala Collections: List vs Vector vs Map Performance

Scala collections explained: immutable vs mutable, List vs Vector vs Array performance, structural sharing, the 2.13 redesign, lazy views, and Java in…

Read article →
ARTICLE · 026

Scala Collections Performance: List vs Vector vs Array Costs

Scala collections performance compared: List, Vector, Array and Map operation costs, views and iterators vs strict transforms, boxing, builders, and p…

Read article →
ARTICLE · 027

Scala Compiler Plugins, in depth: phases, writing the same check for Scala 2 and Scala 3, packaging with sbt, testing, and when a macro or Scalafix rule is the better tool

How Scala compiler plugins work: the phase pipeline, choosing where a plugin phase runs, a complete lint plugin for Scala 3 and Scala 2, plugin descri…

Read article →
ARTICLE · 028

Scala Control Flow, in depth: if and match as expressions, while loops, for-comprehension desugaring, try/throw/Using and early exit with boundary/break

A first-principles guide to control flow in Scala 2 and Scala 3: why if, match and try are expressions, typing rules and the Unit trap, while loops an…

Read article →
ARTICLE · 029

Coursier, in depth: how Scala's dependency resolver reaches a fixed point, reconciles versions, caches artifacts, and runs behind mirrors and in CI

How Coursier resolves and fetches JVM dependencies for sbt, Mill and Scala CLI: the metadata fixed-point loop, highest-wins reconciliation versus Mave…

Read article →
ARTICLE · 030

Scala Currying, in depth: curried function types, curried and uncurried, how parameter lists drive type inference, block-argument DSLs, dependent parameter lists and staged evaluation

Currying in Scala from first principles: curried function types and right associativity, curried, uncurried and tupled conversions, why methods with s…

Read article →
ARTICLE · 031

doobie architecture

Deep-dive on doobie: the sql interpolator and fragment algebra, ConnectionIO composition as transaction boundaries, Transactor and Hikari pool alignme…

Read article →
ARTICLE · 032

Scala DSL Design Patterns, in depth: shallow and deep embeddings, operator rules, context-function builders, phantom types and a worked alerting DSL

How to design internal DSLs in Scala 3: shallow versus deep embedding, operator precedence and infix rules, extension methods, context-function builde…

Read article →
ARTICLE · 033

Scala Effect Systems Compared in Depth: Future, Cats Effect, ZIO and the Direct-Style Newcomers

A practical comparison of Scala effect systems: why lazy effects beat eager Futures, and how Cats Effect and ZIO differ on error channels, dependency …

Read article →
ARTICLE · 034

Scala Either, in depth: right-biased error handling, error ADTs, for-comprehensions, accumulating errors and EitherT

A first-principles guide to Scala's Either: why typed errors beat exceptions, right-bias since 2.12, constructing and transforming Eithers, for-c…

Read article →
ARTICLE · 035

Scala ExecutionContext, in depth: the two-method contract, the global pool, parasitic and opportunistic, custom pools, context propagation and testing

What an ExecutionContext promises and what it does not: execute and reportFailure, sizing global's ForkJoinPool with its system properties, paras…

Read article →
ARTICLE · 036

Scala Existential Types, in depth: forSome, wildcards, skolems, what Scala 3 dropped, and the patterns that replace it

Existential types from first principles: why invariance needs them, Scala 2's forSome and wildcard syntax, how the compiler opens an existential …

Read article →
ARTICLE · 037

Scala Factory Pattern, in depth: companion apply, smart constructors, abstract factories with traits and givens, registries and effectful construction

How the factory pattern really looks in Scala 3: companion object apply and universal apply, smart constructors with private constructors that also hi…

Read article →
ARTICLE · 038

Finagle RPC Explained: Services, Filters, Load Balancing, Retries

Twitter Finagle RPC framework explained: Service and Filter composition, dtab name resolution, P2C and aperture load balancing, retry budgets, Mux ove…

Read article →
ARTICLE · 039

Scala fold + map + filter, in depth: pipeline semantics, strict versus lazy evaluation, fusing passes into one fold, and the Map and Set traps

How map, filter and fold combine into data pipelines on Scala 2.13 and Scala 3 collections: what a strict chain allocates, view, iterator and withFilt…

Read article →
ARTICLE · 040

Scala For-Comprehensions, in depth: the desugaring rules, guards and withFilter, value definitions, sequential Futures, mixing effects and making your own type work

How Scala for-comprehensions really work: the five rewrite rules to map, flatMap, withFilter and foreach, why guards and patterns need withFilter, the…

Read article →
ARTICLE · 041

Scala Free Monads, in depth: programs as data, interpreters as natural transformations, and when Free beats tagless final

A practical guide to free monads in Scala with Cats: why describing a program as data is useful, a from-scratch Free, liftF and foldMap, stack safety …

Read article →
ARTICLE · 042

fs2 Streams in Scala: Pull Model, Chunks, Concurrency

How fs2 streams work in Scala: the pull-based core, chunked throughput, scoped resource safety, merge and parEvalMap concurrency, and fs2-kafka pipeli…

Read article →
ARTICLE · 043

Scala Functional Error Handling, in depth: Option, Try, Either, Validated and typed effect errors, and how to choose between them

A practical guide to functional error handling in Scala: separating expected errors from defects, choosing between Option, Try, Either and Validated, …

Read article →
ARTICLE · 044

Functor and Applicative in Scala, in depth: map, mapN, validation, traverse and parallel effects

A practical guide to Functor and Applicative in Scala with Cats: the type-class hierarchy and its laws, map, ap, product and mapN, error accumulation …

Read article →
ARTICLE · 045

Scala Futures and ExecutionContext: Eager Async, Blocking

Scala Future and ExecutionContext explained: eager async evaluation, thread pools, the global context, blocking calls, map, flatMap, recover, vs IO.

Read article →
ARTICLE · 046

Scala groupBy and partition, in depth: the whole splitting family, what each one traverses and allocates, lazy collections, key traps and a worked import pipeline

A practical guide to splitting Scala collections: partition, partitionMap, span, splitAt, groupBy, groupMap, groupMapReduce, grouped and sliding. How …

Read article →
ARTICLE · 047

Scala Higher-Order Functions

How Scala treats functions as first-class values, the common HOFs (map/filter/fold), and how they enable functional-style data pipelines.

Read article →
ARTICLE · 048

http4s architecture

Deep-dive on http4s: HttpRoutes as Kleisli functions, middleware stacks as composition, entity codecs, fs2 streaming bodies with end-to-end backpressu…

Read article →
ARTICLE · 049

Scala Implicit Resolution: How Givens Are Found

How the Scala compiler resolves implicits and givens: local vs implicit scope, type classes, recursive derivation, priority, ambiguity and divergence …

Read article →
ARTICLE · 050

Scala Implicits: Type Classes and Conversions

Scala implicits explained: implicit parameters, type classes, context bounds, extension methods and implicit conversions, plus what Scala 3 given/usin…

Read article →
ARTICLE · 051

Scala Iron, in depth: refinement types for Scala 3, compile-time and runtime refinement, new types and validating at the boundary

How the Iron library brings refinement types to Scala 3: the :| type, how literals are checked by the compiler and runtime values with refineEither, R…

Read article →
ARTICLE · 052

Scala Iterators, in depth: the single-pass contract, which methods consume, hidden buffers in duplicate, span and partition, BufferedIterator, building your own and resource-safe line processing

How scala.collection.Iterator really behaves in Scala 2.13 and 3: hasNext and next, the rule that an iterator is invalid after most method calls, lazy…

Read article →
ARTICLE · 053

Scala Kittens, in depth: deriving Cats type classes with derives, semiauto, strict mode and law tests

A practical guide to Kittens, the Typelevel library that derives Cats instances such as Eq, Order, Show, Hash, Monoid, Functor and Traverse from the s…

Read article →
ARTICLE · 054

Scala Lagom, in depth: how a Lagom 1.6 service really works, operating it after end of life, and a migration path to plain Akka or Pekko

Lagom reached end of life on 1 July 2024. This guide explains a Lagom 1.6 service from the inside (descriptors, sharded event-sourced entities, tagged…

Read article →
ARTICLE · 055

Scala Lazy Evaluation, in depth: by-name parameters, call-by-need, lazy val internals in Scala 2 and 3, and laziness as suspended effects

How Scala decides when an expression runs: strict, call-by-name and call-by-need evaluation, by-name parameters and control structures, what lazy val …

Read article →
ARTICLE · 056

Scala LazyList (was Stream), in depth: the cell model, what forces evaluation, exceptions and memoization, corecursion, paging with unfold and stack depth

How Scala 2.13's LazyList really evaluates: cells as suspended computations, why it replaced Stream, which operations are lazy and which force, w…

Read article →
ARTICLE · 057

Scala List, in depth: cons cells, structural sharing, the cost model, recursion and stack safety, ListBuffer and when to use something else

How Scala's immutable List works and how to use it well: the :: and Nil algebraic data type, covariance, structural sharing, the cost of every co…

Read article →
ARTICLE · 058

Scala Map, in depth: what Map() builds, safe lookups, updates and merges, iteration order, views, defaults and concurrent maps

A practical guide to Map in Scala 2.13 and Scala 3: the concrete classes behind Map(), apply versus get versus getOrElse and withDefault, updated, upd…

Read article →
ARTICLE · 059

Scala Memoization Patterns, in depth: pure-function caches, recursive memoization, key design, thread safety and bounded caches

How to memoize functions in Scala correctly: when memoization is valid, a generic memoize helper, why memoizing a recursive function misses the inner …

Read article →
ARTICLE · 060

Scala Metals, in depth: the language server, build servers, presentation compiler and SemanticDB, and how to keep them fast

How the Metals Scala language server works and how to operate it: the LSP and BSP split, Bloop versus sbt, Mill and Scala CLI build servers, the prese…

Read article →
ARTICLE · 061

Scala Metaprogramming, in depth: building a compile-time derivation, testing it, debugging it and paying for it

A practical guide to metaprogramming in Scala 3: where each tool runs in the compiler, a full Mirror-based type class derivation with scala.compiletim…

Read article →
ARTICLE · 062

Scala Methods vs Functions, in depth: eta-expansion, what gets lost, identity, initialization order and performance

The difference between Scala methods and function values from first principles: what only methods can do, what only functions can do, eta-expansion ru…

Read article →
ARTICLE · 063

Scala Mill Build Tool

A deep dive on Scala Mill: a modern, fast build tool for Scala as an alternative to sbt. Covers Mill's architecture, functional task graph, build…

Read article →
ARTICLE · 064

Scala Mixins, in depth: composition at definition and instantiation, member conflict rules, stackable traits, Scala 3 changes and when not to mix

Using Scala traits as mixins: definition-time versus instantiation-time composition, the rules for conflicting members and super[T], stackable modific…

Read article →
ARTICLE · 065

Scala Monads

What a monad actually is in Scala: flatMap, map and unit as real method names, the three laws checked against Option, how for-comprehensions desugar, …

Read article →
ARTICLE · 066

MUnit, in depth: the suite lifecycle, assertions and diffs, fixtures, async and cats-effect tests, properties, tags and filtering, extension hooks and pitfalls

How to use MUnit, the Scalameta test library: setup in sbt and scala-cli, how a suite runs as a JUnit runner, assertEquals and its Compare check, asse…

Read article →
ARTICLE · 067

Scala Option, in depth: Option(null) versus Some, the combinators by job, chaining lookups, lists of Options, Java interop and when to switch to Either

How Scala's Option works and how to use it well: the type and its two cases, why Option(x) and Some(x) differ on null, getOrElse and fold evaluat…

Read article →
ARTICLE · 068

Scala Ordering and Sorting, in depth: type classes, stable sorts, composition and the edge cases that bite

How sorting works in Scala 2.13 and Scala 3: Ordering versus Ordered, how instances are found, composing orderings with by, reverse, orElse and orElse…

Read article →
ARTICLE · 069

Scala Overview

What Scala is, why it fused functional and object-oriented paradigms on the JVM, and where it fits versus Java, Kotlin, and pure functional languages.

Read article →
ARTICLE · 070

Scala Partial Application, in depth: placeholder syntax, multiple parameter lists, when arguments are evaluated and what gets lost

A first-principles guide to partial application in Scala 2.13 and Scala 3: fixing some arguments to get a function of the rest, the placeholder rule a…

Read article →
ARTICLE · 071

Scala Path-Dependent Types, in depth: stable paths, type members, dependent methods and the APIs they make safe

Scala path-dependent types from first principles: why g1.Node and g2.Node differ, what counts as a stable path, singleton types, abstract type members…

Read article →
ARTICLE · 072

Scala Phantom Types, in depth: typestate, compile-checked builders, tagged IDs, units and where the guarantees stop

Phantom type parameters in Scala 3 from first principles: zero-cost typestate with =:= and sealed custom evidence, @implicitNotFound error messages, a…

Read article →
ARTICLE · 073

Play Framework architecture

Deep-dive on Play Framework: typed routing and reverse routes, Action composition and body parsers, the default vs blocking execution-context discipli…

Read article →
ARTICLE · 074

Scala Promise

Write-once handle for Future.

Read article →
ARTICLE · 075

Scala Ranges, in depth: to, until and by, the arithmetic of length and last, what stays a Range, NumericRange for Long, Char and BigDecimal, and the edge cases

How Scala ranges work: a Range is start, end, step and an inclusive flag; how to, until and by build ranges; the arithmetic behind length, last, conta…

Read article →
ARTICLE · 076

Referential Transparency in Scala, in depth: the substitution test, what breaks it, effects as values with Cats Effect, and refactoring you can trust

A practical guide to referential transparency in Scala: the substitution test, pure functions versus transparent expressions, the common ways Scala co…

Read article →
ARTICLE · 077

Scala refined, in depth: Refined[T, P], Validate, RefinedTypeOps and the library integrations

A practical guide to the fthomas refined library for Scala 2: how Refined[T, P] and Validate work, compile-time literal checks versus runtime refineV,…

Read article →
ARTICLE · 078

Scala Reflection

Runtime + compile-time.

Read article →
ARTICLE · 079

Scala Sangria, in depth: schema DSL, execution pipeline, Fetchers for N+1, query complexity limits and error handling

How to build a GraphQL server in Scala with Sangria: the Ctx and Val type parameters, defining object types, arguments and derivation, the parse, vali…

Read article →
ARTICLE · 080

sbt for Scala: Settings, Tasks, Scopes, Incremental Builds

How sbt builds Scala projects: the settings graph vs the task graph, scope axes and delegation, Zinc incremental compilation, Coursier, plugins, and C…

Read article →
ARTICLE · 081

Scala 3

Scala 3 as a map: optional indentation syntax, what was removed, given/using and extension, enums and union types, opaque aliases, inline and quotes, …

Read article →
ARTICLE · 082

ScalaCheck Property Testing, in depth: generators, properties, shrinking, seeds and stateful testing

A practical guide to ScalaCheck: how a property run works, building Gen and Arbitrary instances, property patterns that find real bugs, how shrinking …

Read article →
ARTICLE · 083

Scala scalafix, in depth: syntactic and semantic rules, SemanticDB, CI enforcement and writing your own rule

How scalafix works and how to run it well: syntactic versus semantic rules, SemanticDB, sbt setup, the built-in rules, configuration, CI with --check,…

Read article →
ARTICLE · 084

Scala.js, in depth: how Scala compiles to JavaScript and WebAssembly, interop, builds and production pitfalls

Scala.js explained from first principles: the compiler plugin and whole-program linker, sbt and cross-project setup, JVM semantics that change in the …

Read article →
ARTICLE · 085

Scala Native, in depth: NIR, whole-program linking, LLVM, C interop, garbage collectors and when to leave the JVM

How Scala Native turns Scala into a native executable: the NIR compiler plugin, whole-program linking and optimisation, LLVM code generation, build mo…

Read article →
ARTICLE · 086

ScalaTest Framework, in depth: suite styles, matchers, fixtures, async tests, eventually and patience, tags and parallel runs

A practical guide to ScalaTest 3.2.x: how sbt discovers and runs suites, choosing a style, assertions and should matchers, Inside and Inspectors, fixt…

Read article →
ARTICLE · 087

Scala scodec, in depth: composable binary codecs for protocols you do not control

A hands-on guide to scodec: BitVector and ByteVector, the Codec contract with Attempt and DecodeResult, composing tuple codecs, a worked frame protoco…

Read article →
ARTICLE · 088

Scala Sealed Traits and ADTs, in depth: sums, products, illegal states, exhaustivity you can enforce, and evolving the types without breaking callers

How to design algebraic data types in Scala 2 and 3: sum and product types, counting states, making illegal states unrepresentable, sealed trait versu…

Read article →
ARTICLE · 089

Scala Self Types, in depth: requirements without inheritance, the cake pattern and when to use neither

A first-principles guide to Scala self types: syntax, what the compiler checks, self type versus inheritance, mutual dependencies, compound self types…

Read article →
ARTICLE · 090

Scala Set, in depth: the Set contract, immutable and mutable implementations, set algebra, iteration-order and map-deduplication traps, element equality and performance

Scala's Set in depth for Scala 2.13 and Scala 3: what a set guarantees, how Set() picks Set1 to Set4 or a CHAMP HashSet, ListSet, TreeSet and Bit…

Read article →
ARTICLE · 091

Shapeless generic derivation architecture

Deep-dive on shapeless typeclass derivation in Scala: mapping case classes to HLists and sealed traits to Coproducts via Generic/LabelledGeneric, recu…

Read article →
ARTICLE · 092

Scala sliding and grouped, in depth: exact window semantics, partial windows, padding, cost and building training windows

How Scala's grouped and sliding behave at the edges, verified on scala-library 2.13.16: short input, partial last windows, step larger than size,…

Read article →
ARTICLE · 093

Scala Streams

Scala lazy sequences: LazyList structure and memoization, the head-retention leak, views versus iterators, and when laziness actually pays.

Read article →
ARTICLE · 094

Scala Structural Types, in depth: refinements, reflective calls, Selectable, typed records and when a type class is the better tool

How Scala structural types really work: refinement types with term members, Scala 2 reflectiveCalls, the Scala 3 Selectable rewrite to selectDynamic a…

Read article →
ARTICLE · 095

Tagless final architecture

Deep-dive on tagless final in Scala: algebras over F[_], why parametricity rather than testability is the real payoff, MTL-style capabilities, interpr…

Read article →
ARTICLE · 096

Scala Tail Recursion, in depth: what the compiler rewrites, what @tailrec really does, accumulators, explicit stacks, TailCalls and stack-safe monads

How Scala turns self tail calls into loops on a JVM without tail-call elimination: tail position from first principles, the rules scalac applies, what…

Read article →
ARTICLE · 097

Tapir architecture

Deep-dive on Tapir: the Endpoint[I,E,O] description algebra, schema and codec derivation, server/client/OpenAPI interpreters from one value, oneOf err…

Read article →
ARTICLE · 098

Scala Testing in Depth: Choosing a Framework, Property-Based Testing with ScalaCheck, Effectful Code on a Virtual Clock, and Suites That Stay Fast

A practical guide to testing Scala: how sbt discovers and runs suites, choosing between ScalaTest, MUnit and ZIO Test, example-based and property-base…

Read article →
ARTICLE · 099

Scala Traits, in depth: members, trait parameters, linearization by hand, stackable super calls, initialization order and what traits compile to

How Scala traits really work: abstract and concrete members, Scala 3 trait parameters, computing linearization by hand, dynamic super and stackable mo…

Read article →
ARTICLE · 100

Scala Traverse and Sequence, in depth: turning List[F[A]] into F[List[A]], from Option to bounded parallel IO

A first-principles guide to traverse and sequence in Scala: the signature and a hand-written implementation, how Option, Either, Validated, IO and Lis…

Read article →
ARTICLE · 101

Scala TrieMap, in depth: the Ctrie, lock-free updates and constant-time snapshots

How scala.collection.concurrent.TrieMap works and when to use it: the Ctrie node types, CAS-based insertion, O(1) snapshots with generation-tagged cop…

Read article →
ARTICLE · 102

Scala Try, in depth: Success and Failure, what NonFatal really catches, combinators, Using for resources, the Future connection and the traps of eager evaluation

A first-principles guide to scala.util.Try: how Try.apply turns non-fatal exceptions into values, which throwables it deliberately lets through, the c…

Read article →
ARTICLE · 103

Scala Tuples, in depth: what a tuple is at compile time and at runtime, generic tuple operations in Scala 3, named tuples, costs and when to use a case class instead

A complete guide to Scala tuples: syntax, equality and destructuring, how TupleN classes and Scala 3's *: and EmptyTuple representation relate, g…

Read article →
ARTICLE · 104

Scala Type Inference, in depth: local inference, expected types, constraint solving, least upper bounds and the Scala 2 to 3 changes

How Scala's type inference actually works: local and bidirectional inference, how expected types reach lambda parameters, how type arguments are …

Read article →
ARTICLE · 105

Scala Type-Level Programming, in depth: literal types, match types, compiletime ops, inline and given-driven proofs

A first-principles guide to type-level programming in Scala 3: singleton and literal types, match types and their reduction rules, scala.compiletime o…

Read article →
ARTICLE · 106

Scala Type System: Variance, Higher-Kinded Types

The Scala type system explained: generics and erasure, covariance and contravariance, bounds, higher-kinded types, path-dependent types, and union typ…

Read article →
ARTICLE · 107

Scala val vs var, in depth: bindings, generated code, lazy vals, initialization order and when mutation is the right call

What val and var really mean in Scala: bindings versus object mutability, the fields, getters and setters the compiler generates, captured vars and bo…

Read article →
ARTICLE · 108

Scala Vector, in depth: the radix-balanced tree, index arithmetic, path copying, prefix and suffix arrays, builders and benchmarks

How Scala's immutable Vector works inside: a 32-way radix tree with prefix and suffix arrays, how an index becomes a path, why updates copy a few…

Read article →
ARTICLE · 109

Scala Views, in depth: lazy pipelines that recompute, View vs SeqView vs IndexedSeqView, mutable sources, MapView and when strict code wins

How Scala 2.13 and Scala 3 collection views work: iterator chains, no memoization, which operations keep IndexedSeqView, views over mutable buffers, t…

Read article →
ARTICLE · 110

ZIO fibers architecture

Deep-dive on ZIO fibers: lightweight green threads the runtime multiplexes onto a small OS-thread pool so millions run concurrently and a waiting fibe…

Read article →
ARTICLE · 111

ZIO Introduction

What a ZIO effect value is, how to read ZIO[R, E, A], typed errors versus defects, running a program with ZIOAppDefault, and where each concern goes d…

Read article →
ARTICLE · 112

ZIO ZLayer architecture

Deep-dive on ZIO's ZLayer: typed dependency injection where each layer declares its requirements and output in its type so the compiler verifies …

Read article →
ARTICLE · 113

ZIO Runtime Explained: Fibers, Work Stealing, ZLayer in Scala

How the ZIO runtime runs effects: fibers on a work-stealing executor, a separate blocking pool, typed errors and Cause, interruption, Scope, ZLayer an…

Read article →
ARTICLE · 114

ZIO STM: Software Transactional Memory in Scala with TRef

ZIO STM: why locks do not compose, TRef and STM as values, optimistic logs with commit-time validation, retry as fiber-aware blocking, TMap and TQueue…

Read article →
ARTICLE · 115

ZIO ZStream architecture

Deep-dive on ZIO ZStream: the ZChannel core behind streams, pipelines, and sinks; pull-based backpressure and chunking; scoped resource safety and int…

Read article →