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

Fix for juxtaposeDefault to correctly handle empty envelopes #24

Merged
merged 2 commits into from Sep 3, 2012

Conversation

Projects
None yet
2 participants
@byorgey
Member

byorgey commented Aug 31, 2012

This fixes one part of diagrams/diagrams-lib#37 -- in particular, it means that mempty is now an identity element for beside and friends.

I haven't yet investigated the other problem in that issue, but plan to look at it soon -- but it will most likely involve a patch to diagrams-lib.

Brent Yorgey added some commits Aug 31, 2012

Brent Yorgey
New functions envelope[VP]May
envelopeV and envelopeP return the zero vector and origin,
respectively, when called on an empty envelope.  However, sometimes
it's useful to actually know whether the envelope was empty or not
(the zero vector and the origin are legitimate outputs from non-empty
envelopes).  The new functions have their return type wrapped in Maybe
for this purpose.
Brent Yorgey
Add special case in juxtaposeDefault for empty envelope (see #37)
In particular, juxtaposeDefault is now the identity on the second
object if either one has an empty envelope.  In particular this means
that mempty is now an identity element for beside and friends.

@fryguybob fryguybob merged commit 0a457da into master Sep 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment