{"id":68118,"library":"monocle-macro-2-12","title":"Monocle Macro","description":"Provides Scala macros for generating optics (lenses, prisms, etc.) for case classes in the Monocle library.","status":"active","version":"2.1.0","language":"java","source_language":null,"source_url":"https://github.com/optics-dev/Monocle","tags":["scala","optics","lens","macro","monocle"],"install":[{"cmd":"<dependency>\n  <groupId>com.github.julien-truffaut</groupId>\n  <artifactId>monocle-macro_2.12</artifactId>\n  <version>2.1.0</version>\n</dependency>","lang":"xml","label":"Maven"},{"cmd":"implementation 'com.github.julien-truffaut:monocle-macro_2.12:2.1.0'","lang":"groovy","label":"Gradle"}],"dependencies":[],"imports":[{"symbol":"GenLens","correct":"monocle.macros.GenLens"}],"quickstart":{"code":"import monocle.macros.GenLens\n\ncase class Person(name: String, age: Int)\nval nameLens = GenLens[Person](_.name)","lang":"java","description":"Shows how to generate a lens for a case class field using GenLens macro."},"warnings":[{"fix":"Use monocle-macro_2.13 or monocle-macro3 for newer Scala versions.","message":"Scala 2.12 only; not compatible with Scala 2.13 or 3.x.","severity":"breaking","affected_versions":"2.1.0"}],"env_vars":null,"search_vec":"'case':13 'class':14 'etc':11 'generat':7 'len':21 'lens':9 'librari':18 'macro':2,5,22 'monocl':1,17,23 'optic':8,20 'prism':10 'provid':3 'scala':4,19","created_at":"2026-06-17T17:45:50.960152+00:00","updated_at":"2026-06-17T17:45:50.960152+00:00","problems":[],"ecosystem":"maven","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/optics-dev/Monocle","github":"https://github.com/optics-dev/Monocle","docs":"https://appdoc.app/artifact/com.github.julien-truffaut/monocle-macro_2.12/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}