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

removed default implementation of reverseDomain #97

Merged
merged 3 commits into from Aug 15, 2013
Merged

removed default implementation of reverseDomain #97

merged 3 commits into from Aug 15, 2013

Conversation

jeffreyrosenbluth
Copy link
Member

Added reverseDomain implementations for:
Sectionable (SegTree v)
Sectionable (Trail' Line v)
Located a

@@ -138,6 +138,8 @@ instance ( Codomain a ~ V a, Fractional (Scalar (V a)), AdditiveGroup (V a)
splitAtParam (Loc x a) p = (Loc x a1, Loc (x .+^ (a `atParam` p)) a2)
where (a1,a2) = splitAtParam a p

reverseDomain (Loc p a) = Loc p (reverseDomain a)
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I don't think this is correct. Reversing a Located thing might result in a thing with a different location. e.g. see the definition of reverseLocLine here: https://github.com/diagrams/diagrams-lib/blob/master/src/Diagrams/Trail.hs#L868 . The idea is that the new location is what used to be the end (so overall the located thing "stays in the same place"). Concretely, the idea would be to compute the offset of the underlying parametric thing (by subtracting atStart from atEnd) and to add that to the point p to obtain the new location. I am not 100% confident all the types will work out, but I think they should. Let me know if you run into trouble.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, how about the other two?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, everything else looks good.

byorgey added a commit that referenced this pull request Aug 15, 2013
removed default implementation of reverseDomain
@byorgey byorgey merged commit c10448a into diagrams:master Aug 15, 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.

None yet

2 participants