A Scala library for modifying deeply nested fields in case classes with a concise, type-safe syntax.
Quicklens is a Scala library designed to simplify modifying deeply nested fields in immutable case classes. It provides a concise, type-safe syntax for updating complex data structures without manual copying boilerplate, making functional data transformations more readable and maintainable.
Scala developers working with immutable case classes and complex nested data structures, particularly those in functional programming contexts or using libraries like Play Framework, Akka, or Scala.js.
Developers choose Quicklens for its intuitive API that feels like native Scala, its ability to handle complex modifications with minimal code, and its type safety that catches errors at compile time—all without the steep learning curve of full optics libraries.
Modify deeply nested case class fields
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides compile-time checking for nested field paths, eliminating runtime errors from manual copying, as shown in examples like `person.modify(_.address.street.name).using(_.toUpperCase)`.
Supports easy modification of elements in Option, List, and Map with methods like `.each` and `.at`, reducing boilerplate for common collection operations.
Allows creating reusable modification paths with `modifyLens`, enabling code reuse and composition across different data instances.
Works seamlessly with Scala's sealed traits and enums, facilitating modifications across algebraic data types without extra setup.
Using `.at` can throw IndexOutOfBoundsException or NoSuchElementException if elements are missing, which conflicts with functional programming styles that prefer error types like Option.
The README admits `.atOrElse` is not available for sequences due to unclear insertion behavior, restricting flexible defaults in list modifications.
Relies on Scala macros, which can be brittle across different Scala versions and might cause compilation issues in complex or legacy projects.