on master help sign in
jrec/README.md
42 lines 1.4 kB history raw
1# jrec — anonymous records for busy people
3Based on [superrecord](https://hackage.haskell.org/package/superrecord), but simplified. No automatic field reordering. No GHCJS bits inside. Easier to hack on.
5## Benefits
7* Nice construction syntax:
9 ```haskell
10 Rec (#id := 18853, #orderId := "MG13-233")
11 ```
13* Provides `Generic` instances out of the box. Aeson, etc can't believe these aren't normal records! Anything `Generic`-derived just works.
15* Provides `generic-lens` and `generic-optics` instances out of the box. Due to those custom instances, we support polymorphic updates.
17* O(1) field access, O(n) construction.
19* PureScript-style partial records — if you have a `Rec ("foo" := Int ': rest)`, `HasField "foo"` will work just fine.
21## Developing
23IDE support is available inside `nix-shell`. For example, if you use VS Code, you may launch it as:
25```bash
26nix-shell --run "code ."
27```
29### Tests
31Run `bin/test` for fast-reloading tests. When library sources change, the test script will reload instantly and re-run the tests.
33## TODOs
35* Documentation.
36* Expose all internals.
37* `-- NOTE: doesn't use 'KeyDoesNotExist'` — fix this.
38* `RemoveAccessTo` — can we get rid of it?
40## Acknowledgement
42* The `JRec.Internal` module is entirely based on the code from [superrecord](https://hackage.haskell.org/package/superrecord).