Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle records with more than 8 fields #2

Open
tfausak opened this issue Sep 24, 2016 · 3 comments
Open

How to handle records with more than 8 fields #2

tfausak opened this issue Sep 24, 2016 · 3 comments

Comments

@tfausak
Copy link

tfausak commented Sep 24, 2016

The documentation says that "records with up to 8 fields are supported". I have couple questions about that:

  1. 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.
  2. 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!

@PkmX
Copy link
Owner

PkmX commented Sep 24, 2016

  1. 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.

  1. 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.

@PkmX
Copy link
Owner

PkmX commented Mar 27, 2017

As of 9e366a5, 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.

@Wizek
Copy link

Wizek commented Sep 22, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants