fields: First-class record field combinators with infix record field syntax.

[ bsd3, data, library ] [ Propose Tags ]

Using records, especially nested records, in Haskell can sometimes be a bit of a chore. Fortunately, there are several libraries in hackage that make working with records easier. This library is my attempt to build on top of these libraries to make working with records even more pleasant!

In most imperative languages, records are accessed using the infix dot operator. Record fields can be read simply by suffixing a record value with .field and they can be modified by simply assigning to that location. Although this is not the only way to access records (indeed, Haskell does not use it), many people (including myself) like it. This library attempts to support this style for Haskell records in the following manner:

record.field.subfield      becomes     record .# field # subfield
record.field = value       becomes     record .# field =: value

Of course, the infix assignment in Haskell is pure and doesn't actually mutate anything. Rather, a modified version of the record is returned.

In addition, the following features are supported:

For a detailed description of usage, see Data.Record.Field.

This library is a work-in-progress. Some limitations, deficiencies, points of interest and possible future improvements include:

Versions [faq] 0.1.0
Dependencies array (>=, base (==4.*), containers (>=, fclabels (>=0.9.1), monads-fd (>=, transformers (>= [details]
License BSD-3-Clause
Author Jussi Knuuttila
Category Data
Home page
Uploaded by JussiKnuuttila at 2010-08-11T11:15:52Z
Distributions NixOS:0.1.0
Downloads 1062 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]




Maintainer's Corner

For package maintainers and hackage trustees