Extensible records and polymorphic variants.

Version on this page:
LTS Haskell 18.0:
Stackage Nightly 2021-06-21:
Latest on Hackage:

See all snapshots data-diverse appears in

BSD-3-Clause licensed by Louis Pan
Maintained by
This version can be pinned in stack with:data-diverse-,3181

Hackage Build Status

“Data.Diverse.Many” is an extensible record for any size encoded efficiently as (Seq Any).

“Data.Diverse.Which” polymorphic variant of possibilities encoded as (Int, Any).

Provides getters, setters, projection, injection, folds, and catamorphisms; accessed by type or index or label.

Refer to ManySpec.hs and WhichSpec.hs for example usages.

Iso, Lens and Prisms are provided in data-diverse-lens


  • Initial version represented as (Int, Data.Map Int Any)

  • Removed Emit typeclass, breaking renames. Added label accessors.

  • Renamed type level functions module from Type to TypeLevel

  • Moved lens to data-diverse-lens

  • Removed NOINLINE pragmas. Changed internal representation to (Int, Data.IntMap Any) for a 2.5x append speedup.

  • Changed internal representation to (Data.Seq Any) for a further 2x append speedup. Added NFData instance for Many

  • Added NFData instance for Which Forgot to expose Many.sliceL and Many.sliceR