Skip to content
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

Combine (point, bounds) pairs stored in NameMap into a single "located bounding function" data structure #14

Closed
fryguybob opened this issue Aug 4, 2012 · 0 comments
Assignees

Comments

@fryguybob
Copy link
Member

(Imported from http://code.google.com/p/diagrams/issues/detail?id=55. Original issue from byor...@gmail.com on September 23, 2011, 10:42:16 PM UTC)

This has several benefits:

  • no need to annoyingly match on a pair when using withName
  • boundaryFrom can be refactored to just work on one of these "located bounding functions" instead of taking the bounds and base point as separate arguments
  • if we ever want to remember additional information for named diagrams we just have to add a new field to the data structure.

Of course, the downside is that if all you want is the point you have to use a projection function to get it out. But you already had to pattern match on a pair to get at it anyway, so maybe this isn't a downside at all -- with a projection function you don't have to remember which of the two components comes first in the tuple!

Don't forget to update the user manual to match.

@ghost ghost assigned byorgey Aug 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants