-
Notifications
You must be signed in to change notification settings - Fork 108
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
Hide the constructors and raw record fields of message types. #174
Conversation
They're not that useful for constructing values (especially after adding the "unknown fields" case) and were previously mostly used for documentation. Now that google#172 has landed, we have a better source of documentation that doesn't expose internal details. Also change the `Show` instance for messages to be a wrapper around `showMessageShort`. This both hides the now-inaccessible record fields and shortens the output in most cases. For example: ``` > print (def :: DescriptorProto) {} > print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto) {name: "hello" field { } field { name: "bye" }} ``` Also bump the resolver for bootstrapping to match the regular build. Hide message constructors. showsPrec, and bootstrap
@@ -1,4 +1,4 @@ | |||
resolver: lts-9.21 | |||
resolver: lts-10.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this foreclose any bootstrap options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really; as long as we keep testing the older LTS's in TravisCI, we'll be reasonable sure it's possible to bootstrap with older versions by manually editing this file. I think it's just more convenient for developers if this is in sync with stack.yaml
.
Unfortunately this causes problems related to #167; since the types don't have exposed constructors, users can't derive their own instances for them. For example: https://travis-ci.org/google/proto-lens/jobs/335018254 Leaving open for now while I try to think of a workaround. |
…#174) Finishes google#158. They're not that useful for constructing values (especially after adding the "unknown fields" case) and were previously mostly used for documentation. Now that google#172 has landed, we have a better source of documentation that doesn't expose internal details. Also change the `Show` instance for messages to be a wrapper around `showMessageShort`. This both hides the now-inaccessible record fields and shortens the output in most cases. For example: ``` > print (def :: DescriptorProto) {} > print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto) {name: "hello" field { } field { name: "bye" }} ``` Also bump the resolver for bootstrapping to match the regular build.
…#174) Finishes google#158. They're not that useful for constructing values (especially after adding the "unknown fields" case) and were previously mostly used for documentation. Now that google#172 has landed, we have a better source of documentation that doesn't expose internal details. Also change the `Show` instance for messages to be a wrapper around `showMessageShort`. This both hides the now-inaccessible record fields and shortens the output in most cases. For example: ``` > print (def :: DescriptorProto) {} > print (def & #name .~ "hello" & #field .~ [def, def & #name .~ "bye"]:: DescriptorProto) {name: "hello" field { } field { name: "bye" }} ``` Also bump the resolver for bootstrapping to match the regular build.
They're not that useful for constructing values (especially after adding the
"unknown fields" case) and were previously mostly used for documentation. Now
that #172 has landed, we have a better source of documentation that doesn't
expose internal details.
Also change the
Show
instance for messages to be a wrapper aroundshowMessageShort
. This both hides the now-inaccessible record fields andshortens the output in most cases. For example:
Also bump the resolver for bootstrapping to match the regular build.
Hide message constructors.
showsPrec, and bootstrap
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)