-
Notifications
You must be signed in to change notification settings - Fork 43
No mco #62
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
No mco #62
Conversation
I'm not sure I believe this. Where do transformations get applied to styles now? What happens with the following code:
? |
good question. what should happen? |
I think it happens in fromDTree. |
Unfortunately not. I'll have to look into it. |
oops, didn't mean to close. |
The problem is that transformations and styles are just accumulated in parallel, and transformations never have a chance to act on the styles. When converting to I think the solution would be that So it looks like it really is more complicated than we thought. Probably at this point we should just abandon the idea for now. |
Ah, I see. It was a good experiment though. |
=) Sounds good. |
What if we rewrote the |
That would work (I think), but I don't like it, because it nullifies any efficiency benefit we get from accumulating transformations and then doing only a single accumulating pass down the tree. Imagine a large tree to which we apply repeated transformations (it's not that hard to construct a plausible scenario where this happens). Under your scheme we would have to traverse the entire tree for each transformation being applied, whereas currently applying each transformation is O(1) and we only have to traverse the tree once at the very end, accumulating transformations as we go down. |
Fair enough. I'll close the this pull request. The only other solutions i can think of are isomorphic to mco or worse. |
OK. Incidentally, the reason the fixed-point formulation of diagrams can get away without monoid coproducts but also would not suffer from the performance penalty I described above, is that we essentially re-imagine the semantics of diagrams as a fold over a deep embedding. That is, imagine if diagrams were constructed as something like a |
Thanks for explaining. That makes it very clear. On Wed, Apr 9, 2014 at 3:35 PM, Brent Yorgey notifications@github.comwrote:
|
Successfully removed monoid coproduct.
Should be OK to merge
Companion branch in -lib