How to handle records with more than 8 fields
The documentation says that "records with up to 8 fields are supported". I have couple questions about that:
- Is it possible to give a better error message when you try to use a record with more than 8 fields? Currently I get a bunch of
Label "foo" does not occur in R ( (...) )errors. - Can the limit be increased? In the past I have used a record with 46 fields.
By the way, thanks for making such a wonderful library!
- Is it possible to give a better error message when you try to use a record with more than 8 fields? Currently I get a bunch of
Label "foo" does not occur in R ( (...) )errors.
Error messages regarding too many fields is something I haven't worked on yet. I will look into it.
- Can the limit be increased? In the past I have used a record with 46 fields.
In the future, yes. I would like to convert all those instances in rawr to be TH-generated at some point, so changing the number of supported fields will be as simple as changing a number. This is going to take a while though because there will be quite a lot of TH to write.
As of 9e366a58d988526bbfd017471952e68e7266d27b, error messages when attempting to construct records with over 8 fields should be improved:
> R ( #a := (), #b := (), #c := (), #d := (), #e := (), #f := (), #g := (), #h := () ) :*: R ( #i := () )
<interactive>:3:1: error:
• RecCons: too many fields
...
I'm keeping this issue open until records with >8 fields are supported.
Great! I'd quite like if more than 8 could be supported as well.
I'm also experimenting with bookkeeper, which does seem to support unlimited amount of fields (tried with 9 and 10 just now), but compile time seems to increase non-linearly (O(n^2) or O(2^n) maybe?) with adding fields.
Even just loading a 10-field book into ghci takes about 20 seconds on my system.
Is this explosion of compile time the reason why rawr prohibits fields greater than 8? Or can we, once the aforementioned TH code is written, have near-instant compile times with 15-field ad-hoc records with rawr?