-
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
Make cat' and friends accumulate seperation between empty diagrams #130
Conversation
@@ -323,7 +325,7 @@ instance Num (Scalar v) => Default (CatOpts v) where | |||
-- | |||
-- See also 'cat'', which takes an extra options record allowing | |||
-- certain aspects of the operation to be tweaked. | |||
cat :: ( Juxtaposable a, Monoid' a, HasOrigin a | |||
cat :: ( Enveloped a, Juxtaposable a, Monoid' a, HasOrigin a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, adding an Enveloped
constraint back is super annoying. This was the original reason I split out a separate Juxtaposable
class, because some things (e.g. animations) are Juxtaposable
but not Enveloped
. I think I now remember running into this the last time I thought about #37. Am I correct that all you need is to be able to tell whether the things being concatenated are empty or not? That is a much weaker requirement than having an envelope. Maybe we should make a separate class for that (and add it as a superclass of Juxtaposable
, probably).
Conflicts: src/Diagrams/Combinators.hs
I took another pass at what this might look like without the For example, I'd expect a class law like
(Which is still useful for types that are I don't think that there is an instance |
Yes, I would expect that law for I am not worried about non-empty I think you are right not to make |
I don't understand the design here enough to finish this. Since there are plenty of other areas I can keep working on, I'd rather leave this one to you. Sorry for the false starts. |
No worries, thanks for looking at it. False starts are still better than nothing, and we've certainly learned some things from them! I'll try to take another careful shot at this at some point, though maybe not until after the 1.0 release. |
closes #37
@byorgey, is this how you want to handle #37?
The test code:
produces the following output, as expected: