-
Notifications
You must be signed in to change notification settings - Fork 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
More problems with beside + mempty #37
Comments
To add a bit more information, here is what is currently produced: The problem with the second is that
I think it should be easy to make |
Making I looked into the other issue a bit and fixing it seems trickier. The key thing to look at is the implementation of One possibility (slightly ugly, perhaps, but maybe not so bad) is to keep another accumulator storing the current "offset", which is the amount to translate each new diagram before composing. Normally, this offset will be equal to Oh... I just realized that
Hrm, I'm pretty sure that's associative but I'm not sure it's quite what is needed. I'll keep thinking about it. |
I think I now have this figured out. What is really needed is
The idea is that Pair each diagram with a value of type
and pair the resulting combined diagram with the combination of their Intuitively I'm quite sure this is correct, though it might be interesting to prove formally that this gives something equivalent to |
See diagrams/monoid-extras#2 . |
Hi, I come here because I expected the original behaviour but found that you seem to have hardcoded mempty to be a left identity of |
Hi @phischu , I'm not going to change back the behavior of However, if the documentation is incorrect that is of course a bug which should be fixed ASAP! Can you be more specific---where exactly is the documentation which needs to be corrected? |
The documentation for |
You are absolutely right, thanks! I've created #83 to track this. I (or someone else) will probably fix it this weekend at Hac Phi. |
For my own understanding, I modified cat' as byorgey described above. I haven't thought through the semantics, or tested beyond that it builds. |
(Imported from http://code.google.com/p/diagrams/issues/detail?id=82. Original issue from byor...@gmail.com on May 24, 2012, 08:10:44 PM UTC)
Consider these example definitions:
In both cases the output is not what I would expect. Either diagrams or my expectations need to be fixed, and the results thoroughly documented in either case.
The text was updated successfully, but these errors were encountered: