Skip to content

Add lookupName function. #41

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

Merged
merged 1 commit into from
Aug 14, 2013
Merged

Add lookupName function. #41

merged 1 commit into from
Aug 14, 2013

Conversation

cmears
Copy link
Contributor

@cmears cmears commented Aug 14, 2013

Example of use:

-- If a straight line was drawn between two named subdiagrams, but
-- stopped at the edge of each subdiagram, where would the endpoints be?
connectionPoints n1 n2 d = do
  b1 <- lookupName n1 d
  b2 <- lookupName n2 d
  let v = location b2 .-. location b1
      midpoint = location b1 .+^ (v/2)
      p1 = fromJust $ traceP midpoint (-v) b1
      p2 = fromJust $ traceP midpoint v b2
  return (p1,p2)

(We also need to export it in diagrams-lib.)


- new function `lookupName` for retrieving a subdiagram with a
given name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, please don't add stuff to the top of CHANGES.markdown -- it screws up my automated scripts for making minor (bug fix-level) releases, causes merge conflicts with the stable release branch, etc. Perhaps instead we should make a file called CHANGES-HEAD.markdown or something like that, which can be added to the top of CHANGES.markdown when the time comes to make a new feature release?

@byorgey
Copy link
Member

byorgey commented Aug 14, 2013

Looks good, other than my comment re: CHANGES.markdown.

cmears added a commit that referenced this pull request Aug 14, 2013
Add lookupName function.
@cmears cmears merged commit 7a71314 into diagrams:master Aug 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants