Skip to content

Idea: there is no "true" representation. Allow functors between equivalent forms #16

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

Open
strangemonad opened this issue Nov 11, 2017 · 2 comments

Comments

@strangemonad
Copy link
Owner

Eg. maybe 2 definitions of Instant. It should be possible to just define mappings in both directions. But we need to capture the semantic sense of the object (e.g. in the case of 2 different instants, the granularity and extent).

see PFPL 17.4 (representation independence of existential / abstract types and solving semantic type equations). The question becomes, what domain to interpret things in (e.g. for the granularity and extent of 2 instant types Instant({seconds:long, nanos:long}) MyInstant({millis:long}).

  1. Should conversion with known loss of precision ever be allowed? eg: instant.toMyInstantWithLoss() (lots of potential right / wrong ways to round and all are application specific e.g. truncate, even odd, redistribute the lost accuracy etc etc)
  2. MyInstant can always be converted into Instant (just capture this as a subtype / type refinement problem)?
  3. Not always possible (e.g. UTF8 string to ASCII or LATIN-1 string or some other encoding that can't express all the unicode code points)
@strangemonad
Copy link
Owner Author

strangemonad commented Nov 13, 2017

Pullbacks / fiber products might be a way to define abstract concepts more specifically along different dimensions of interpretation of the type.

E.g. and Instant has an interpretation along a “granularity” dimension and along a “extents” dimention (and no other). The pullback of these is the set of all representable instants.

By pasting, if one of the dimensions is it self a fiber product, we can continue “refining”

@strangemonad
Copy link
Owner Author

Might have some overlap with #14

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

No branches or pull requests

1 participant