Internal refactoring: Use "trees that grow" for BriDoc #50

Open
opened 2017-08-20 16:50:56 +02:00 by lspitzner · 0 comments
lspitzner commented 2017-08-20 16:50:56 +02:00 (Migrated from github.com)

See Trees that Grow paper by Najd, Jones.

This approach can merge BriDocFInt and BriDoc without adding any by adding minimal (source-text) overhead in any functions that use these types. (There will be some overhead in the representation of BriDoc nodes, but I don't think that general performance will suffer much.)

Unfortunately syb/uniplate are not very compatible with this approach, as far as I can see. E.g. we would not be able to use uniplate in its current form to express a transformation BriDoc StageOne -> BriDoc StageTwo. This is rather sad, as it would have allowed us to restrict which constructors exist in which stages, so we could statically ensure things instead of having ugly stuff such as BDAlt{} -> error "briDocLineLength BDAlt" around (see Backend.hs).

See [Trees that Grow](http://www.jucs.org/jucs_23_1/trees_that_grow/jucs_23_01_0042_0062_najd.pdf) paper by Najd, Jones. This approach can merge `BriDocFInt` and `BriDoc` ~~without adding any~~ by adding minimal (source-text) overhead in any functions that use these types. (There will be some overhead in the representation of BriDoc nodes, but I don't think that general performance will suffer much.) Unfortunately syb/uniplate are not very compatible with this approach, as far as I can see. E.g. we would not be able to use uniplate in its current form to express a transformation `BriDoc StageOne -> BriDoc StageTwo`. This is rather sad, as it would have allowed us to restrict which constructors exist in which stages, so we could statically ensure things instead of having ugly stuff such as `BDAlt{} -> error "briDocLineLength BDAlt"` around (see Backend.hs).
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hexagoxel/brittany#50
There is no content yet.