-
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
Improve the field-related documentation/API #158
Comments
Update: we already have field-level Haddock comments; the rest is happening in #174. |
Is this issue ready to be closed now? |
We can close it after #174 gets merged. |
judah
added a commit
that referenced
this issue
Aug 26, 2018
Finishes #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 #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.
avdv
pushed a commit
to avdv/proto-lens
that referenced
this issue
Aug 9, 2023
…#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.
ylecornec
pushed a commit
to ylecornec/proto-lens
that referenced
this issue
Feb 19, 2024
…#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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some related changes to help simplify the API around fields in proto-lens:
Hide the constructors for proto messages. They're even less useful than before now that we have unknown fields. (Developers can still click
source
in the Haddock docs to see the underlying implementation.)Make the
Show
instance not display the internal fields, instead using the text format, for example:Add Haddock comments for every proto message that list the names and types of all available lenses. Note: this is a little tricky (but doable) since
haskell-src-exts
doesn't easily support inserting top-level comments. (Note: include the accessor for unknown fields.)The text was updated successfully, but these errors were encountered: