{"id":13687117,"url":"https://github.com/kcsongor/generic-lens","last_synced_at":"2025-12-11T23:14:58.987Z","repository":{"id":10908582,"uuid":"67448707","full_name":"kcsongor/generic-lens","owner":"kcsongor","description":"Generically derive traversals, lenses, and prisms.","archived":false,"fork":false,"pushed_at":"2025-04-07T09:20:49.000Z","size":1040,"stargazers_count":441,"open_issues_count":40,"forks_count":55,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-14T02:16:08.403Z","etag":null,"topics":["generics","lenses","optics","traversals","type-level-programming"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kcsongor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["kcsongor"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-09-05T20:22:28.000Z","updated_at":"2025-04-07T09:20:54.000Z","dependencies_parsed_at":"2024-06-18T10:11:24.768Z","dependency_job_id":"8a2bca4e-b416-4803-8e0f-f511adaf0e4d","html_url":"https://github.com/kcsongor/generic-lens","commit_stats":{"total_commits":302,"total_committers":25,"mean_commits":12.08,"dds":0.3410596026490066,"last_synced_commit":"4b34e49fe38ae7ae6e6616ad4fba58d1014212eb"},"previous_names":["kcsongor/generic-records"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcsongor%2Fgeneric-lens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcsongor%2Fgeneric-lens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcsongor%2Fgeneric-lens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcsongor%2Fgeneric-lens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kcsongor","download_url":"https://codeload.github.com/kcsongor/generic-lens/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254202845,"owners_count":22031846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generics","lenses","optics","traversals","type-level-programming"],"created_at":"2024-08-02T15:00:48.996Z","updated_at":"2025-12-11T23:14:58.960Z","avatar_url":"https://github.com/kcsongor.png","language":"Haskell","funding_links":["https://github.com/sponsors/kcsongor"],"categories":["Haskell"],"sub_categories":[],"readme":"# generic-lens\n\n[![Build Status](https://travis-ci.org/kcsongor/generic-lens.svg?branch=master)](https://travis-ci.org/kcsongor/generic-lens)\n[![Hackage](https://img.shields.io/hackage/v/generic-lens.svg)](https://hackage.haskell.org/package/generic-lens)\n\nGenerically derive isos, traversals, lenses and prisms.\n\nThis library uses `GHC.Generics` to derive efficient optics (traversals, lenses\nand prisms) for algebraic data types in a type-directed way, with a focus on\ngood type inference and error messages when possible.\n\nThe library is described in the paper:\n\u003e Csongor Kiss, Matthew Pickering, and Nicolas Wu. 2018. Generic deriving of generic traversals. Proc. ACM Program. Lang. 2, ICFP, Article 85 (July 2018), 30 pages. DOI: https://doi.org/10.1145/3236780\n\n## Package structure\n\n* [`generic-lens`](https://hackage.haskell.org/package/generic-lens):\n  Generic derivation of van Laarhoven optics, compatible with the\n  [`lens`](https://hackage.haskell.org/package/lens) library. There\n  is no dependency on `lens`, however, and other mainstream lens libraries\n  sharing the same interface are supported just as well.\n  \n* [`generic-optics`](https://hackage.haskell.org/package/generic-optics):\n  Generic derivation of optics compatible with the [`optics`](https://hackage.haskell.org/package/optics)\n  library.\n\n* [`generic-lens-core`](https://hackage.haskell.org/package/generic-lens-core):\n  The bulk of the work happens here. Indeed, `generic-lens` and\n  `generic-optics` are just thin layers on top of `generic-lens-core`.\n  \n`generic-lens` are `generic-optics` are designed to be drop-in\nreplacements for each other. This means that they share the same module names. If, for\nwhatever reason, they are both used in the same project, the module imports can be disambiguated\nusing the `-XPackageImports` extension.\n\n## Getting started\nA typical module using `generic-lens` or `generic-optics` will usually have the following\nextensions turned on:\n```haskell\n{-# LANGUAGE AllowAmbiguousTypes       #-}\n{-# LANGUAGE DataKinds                 #-}\n{-# LANGUAGE DeriveGeneric             #-}\n{-# LANGUAGE DuplicateRecordFields     #-}\n{-# LANGUAGE FlexibleContexts          #-}\n{-# LANGUAGE NoMonomorphismRestriction #-}\n{-# LANGUAGE TypeApplications          #-}\n```\n\nIn particular, `NoMonomorphismRestriction` can be helpful as it\nenables proper type inference for top-level functions without a type\nsignature.\n\nFor usage examples, visit the documentation on hackage, or have a look\nin the `examples` and `tests` folders in `generic-lens` or\n`generic-optics`.\n\n## Performance\nThe runtime characteristics of the derived optics is in most cases identical at\n`-O1`, in some cases only slightly slower than the hand-written version. This\nis thanks to GHC's optimiser eliminating the generic overhead.\n\nThe\n[inspection-testing](https://hackage.haskell.org/package/inspection-testing)\nlibrary is used to ensure (see [here](test/Spec.hs)) that everything gets\ninlined away.\n\nThere is also a [benchmark suite](https://github.com/mpickering/generic-lens-benchmarks) with larger, real-world examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcsongor%2Fgeneric-lens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkcsongor%2Fgeneric-lens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcsongor%2Fgeneric-lens/lists"}