-
Notifications
You must be signed in to change notification settings - Fork 184
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
Add Box abstraction #1099
Add Box abstraction #1099
Conversation
A box is something that runs before and after a [Fmt.t]. This ensures that the corresponding "open" and "close" part are properly balanced by always maintaining them together.
Note that we already use functional boxes (eg. Only the code formatting modules uses imperative open/close functions and this is not making it safe (a little safer but not safe) and requires extra |
I think that the main two benefits to this approach are:
|
(this is not for immediate merge and won't solve all our issues but it's a good starting point to discuss some improvements - the API can be made lighter as well) |
I don't agree. The unsafe part of I don't think we have an abstraction problem. The unsafe open/close functions are only used marginally and will be removed in the future. |
Marking Lines 3672 to 3685 in fdbd2f5
It does not contain a call to Does this make sense? |
That makes sense. But I suggest to change this code to not use these functions instead. We tried before and did not succeed, though. |
We'll find something better, closing. |
A box is something that runs before and after a
Fmt.t
. This ensures that the corresponding "open" and "close" part are properly balanced by always maintaining them together.(This might be superseded by #1074)