# generics-sop

> Datatype-generic programming in Haskell using true sums of products

Source: https://talira.ai/catalog/generics-sop-78ypdxsc
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / functional programming](https://talira.ai/categories/libraries/functional-programming), [languages / haskell](https://talira.ai/categories/languages/haskell)
- Licence: BSD-3-Clause[^1][^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Well-Typed](https://talira.ai/orgs/well-typed.md)

generics-sop is a [Haskell](https://talira.ai/catalog/haskell-jjq1dx6f.md) library for writing generic functions: it views every datatype uniformly, with the choice of constructor as an n-ary sum and each constructor's fields as an n-ary product. It builds on sop-core, which holds the n-ary sums and products, and is based on Edsko de Vries and Andres Löh's paper "True Sums of Products". Companion packages show it in use for pretty-printing, lenses and JSON conversion. It's made by Well-Typed.

## Links

- GitHub: https://github.com/well-typed/generics-sop

## Problems it solves

- write a generic function over any Haskell record type
- derive JSON conversion generically in Haskell
- datatype-generic programming without GHC.Generics boilerplate

## Features

- n-ary sum of products view of datatypes
- sop-core for n-ary sums and products
- examples for pretty-printing, lenses and JSON

## Trust

Overall: 0.29 out of 1.
Signals: maintenance 0.27, adoption 0.45, momentum 0.10, community 0.56, backing 0.30, extensibility 0.00.

- 168 GitHub stars
- 24 contributors
- backed by Well-Typed

Warnings:

- last commit 10 months ago

## Sources

[^1]: https://github.com/well-typed/generics-sop/blob/master/LICENSE (checked 29 Nov 2026)
[^2]: https://github.com/well-typed/generics-sop/blob/master/generics-sop/generics-sop.cabal (checked 29 Nov 2026)
