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

change Codomain of Located to Point (Codomain a) #102

Merged
merged 1 commit into from Sep 5, 2013

Conversation

byorgey
Copy link
Member

@byorgey byorgey commented Sep 5, 2013

Switch from

Codomain (Located a) = Located (Codomain a)

to

Codomain (Located a) = Point (Codomain a)

When calling atParam on e.g. a Located (Trail R2), I expect to get a
P2, not a Located R2 (though of course the latter can be converted to
the former).

This also means that instead of requiring constraints of the form

V (Codomain a) ~ V a

we instead have

Codomain a ~ V a

which makes more sense: we can only add a location to
translation-invariant things, and translation-invariant parametric
things are precisely those things whose codomain is a vector space.

@fryguybob , does this make sense to you? I think you're the one who has worked with Located the most.

switch from

  Codomain (Located a) = Located (Codomain a)

to

  Codomain (Located a) = Point (Codomain a)

When calling atParam on e.g. a Located (Trail R2), I expect to get a
P2, not a Located R2 (though of course the latter can be converted to
the former).

This also means that instead of requiring constraints of the form

  V (Codomain a) ~ V a

we instead have

  Codomain a ~ V a

which makes more sense: we can only add a location to
translation-invariant things, and translation-invariant parametric
things are precisely those things whose codomain is a vector space.
@fryguybob
Copy link
Member

This makes sense to me. I've updated the expand branch and this allows me to use atEnd and atStart directly. The notion that only translation-invariant things should be located leads to a specialized mapLoc when you are mapping to something located: mapLoc :: V a ~ V b => (a -> b) -> Located a -> Located b with b ~ Located c gives mapLoc :: V a ~ V c => (a -> Located c) -> Located a -> Located (Located c). In Diagrams.TwoD.Offset in the expand branch I have bindLoc but I don't know if the type for it is too general. I think what we want is bindLoc :: V a ~ V c => (a -> Located c) -> Located a -> Located c. Anyway, I'll merge this now.

fryguybob added a commit that referenced this pull request Sep 5, 2013
change Codomain of Located to Point (Codomain a)
@fryguybob fryguybob merged commit f3d0a6b into master Sep 5, 2013
@fryguybob fryguybob deleted the parametric-Located branch September 5, 2013 02:48
@byorgey
Copy link
Member Author

byorgey commented Sep 5, 2013

Yes, something like bindLoc :: V a ~ V c => (a -> Located c) -> Located a -> Located c makes sense to me.

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