BSD-3-Clause licensed by Matt Parsons
Maintained by [email protected]
This version can be pinned in stack with:prairie-0.1.2.0@sha256:bef4d8e9bf83106c99ab59d1da43c4150ef87298018a2bd7aa5b7f40abd1c345,2325

prairie

Build Status

A library for first class record fields.

Changes

Changelog for prairie

0.1.2.0

  • #26
    • mkRecord now supports record types with type variables (e.g. data Box a = Box { contents :: a }).
  • #27
    • Added mkRecordWith, the abstract PrairieOptions type, and defaultPrairieOptions. mkRecord is now mkRecordWith defaultPrairieOptions and its generated code is unchanged. The PrairieOptions constructor is intentionally not exported, so adding options later is not a breaking change.
    • mkRecordWith defaultPrairieOptions { useTypeEquality = True } generates the SymbolToField instances with a ~ equality constraint binding the field type, instead of placing it directly in the instance head. This admits field types that an instance head rejects — most notably type-family applications (e.g. data Test m = Test { field :: Family m Int }). It is opt-in because the ~ constraint requires the TypeOperators extension at the use site; default mkRecord behaviour is unaffected. Using a type-family field without enabling useTypeEquality now produces a descriptive error.

0.1.1.0

  • #24
    • Introduce sequenceRecordA, for monadic tabulation of values, using Distributed.
  • #29
    • Bump template-haskell bound to 2.25

0.1.0.0

  • #22
    • Don’t emit unused type variables
  • #20
    • Add tabulateRecordApply which is like tabulateRecordA but allows you to use non-Applicaive effects.
    • Prairie.Fold: foldMapRecord now works with any Semigroup instead of any Monoid, allowing you to fold into a NonEmpty list.
    • Prairie.Traverse:
      • traverseRecord_ introduced as a slightly more efficient form of void . traverseRecord f.
      • traverseFields and traverseFields_ introduced to only operate on fields, not requiring a whole record.
      • traverseFieldsWithDict (and _ suffix variant) introduced to operate on fields with a constraint available.
  • #5, #21
    • The Prairie.Distributed module is made available. This allows you to define records that are constructed on a per-field basis in some effect type.
  • #23
    • Generated code is no longer ambiguous or faulty in the case of NoFieldSelectors or DuplicateRecordFields.
    • mkRecord now requires TypeApplications to compile.

0.0.4.1

  • #18
    • Drop lens dependency

0.0.4.0

  • #13
    • Introduce Prairie.Semigroup, allowing you to combine two records by semigroup-appending their fields together.
    • Introduce Prairie.Zip, allowing you to combine two records by specifying how to combine their fields. This fuels Prairie.Semigroup.
    • Introduce Prairie.Monoid, allowing you to make an emptyRecord with mempty at each field.
    • Introduce Prairie.AsRecord, allowing you to derive instances for records based on their Record and FieldDict instances.

0.0.3.0

  • #8
    • The Prairie.Fold module is introduced, allowing you to fold records.
    • The Prairie.Traverse module is introduced, allowing you to traverse over records.

0.0.2.1

  • #6
    • Bump upper bound for TemplateHaskell, supporting up to GHC 9.8
    • Fix string literals in docs that were quoted as module names

0.0.2.0

  • #2
    • Add tabulateRecordA to Record class. tabulate and allFields are now normal functions.
    • Provide a default implementation of recordFieldLabel for Showable fields.

0.0.1.1

  • #4
    • Compatibility with template-haskell-2.18 and above