mirror of
https://github.com/juspay/jrec.git
synced 2024-11-09 13:34:42 +03:00
Literally the best anonymous records
.github/workflows | ||
src | ||
.gitignore | ||
CHANGELOG.md | ||
default.nix | ||
jrec.cabal | ||
LICENSE | ||
README.md | ||
Setup.hs |
jrec — anonymous records for busy people
Based on superrecord, but simplified. No automatic field reordering. No GHCJS bits inside. Easier to hack on.
Benefits
-
Nice construction syntax:
Rec (#id := 18853, #orderId := "MG13-233")
-
Provides
Generic
instances out of the box. Aeson, etc can't believe these aren't normal records! AnythingGeneric
-derived just works. -
Provides
generic-lens
instances out of the box. Due to those custom instances, we support polymorphic updates. -
O(1) field access, O(n) construction.
-
PureScript-style partial records — if you have a
Record ("foo" := Int ': rest)
,HasField "foo"
will work just fine.
TODOs
- Documentation.
- Expose all internals.
-- NOTE: doesn't use 'KeyDoesNotExist'
— fix this.RemoveAccessTo
— can we get rid of it?