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

Finer data exports #851

Merged
merged 2 commits into from Dec 7, 2022
Merged

Finer data exports #851

merged 2 commits into from Dec 7, 2022

Conversation

endgame
Copy link
Collaborator

@endgame endgame commented Dec 2, 2022

Selectively re-export bits of Amazonka.Data through Amazonka.Core, to avoid picking up serialisation classes/helpers which are only really of interest to service bindings. While it's important for library clients to get access to Amazonka.Data.Body, _Base64, _Sensitive, etc., it's very odd for for them to see Aeson's classes and functions re-exported by module Amazonka.

Please have a look at the changed examples to get a feel for how this looks in practice; there shouldn't be much of a change for library consumers. ToText and ToByteString are no longer exported by Amazonka; I think the examples make it look like a noisier problem than it will be in "real" code.

Once again, this means a full regeneration of everything; the branch is endgame/amazonka/finer-data-exports-gen.

Ping @ysangkok who reported this issue.

Closes #777
Fixes #728

@endgame endgame mentioned this pull request Dec 2, 2022
@endgame endgame added this to the 2.0 milestone Dec 2, 2022
This stops `Amazonka.Core` from re-exporting serialisation and
deserialisation stuff from `Amazonka.Data` and polluting the
namespaces of library clients. In particular, nobody expects to
see Aeson stuff exported by module `Amazonka`.
@ysangkok
Copy link
Contributor

ysangkok commented Dec 6, 2022

Looks good! I see that stuff like runResourceT is exported on purpose, which makes sense, since it becomes more convenient. These are also this available after cabal repl in amazonka, not sure whether that is on purpose:

ghci> :info toSeconds
toSeconds :: Seconds -> DiffTime 	-- Defined in ‘Amazonka.Types’
ghci> :info toMicroseconds 
toMicroseconds :: Seconds -> Int 	-- Defined in ‘Amazonka.Types’

But this is definitely an improvement, so looks good to me!

@endgame
Copy link
Collaborator Author

endgame commented Dec 6, 2022

Those exports exist on current main, and I can imagine people wanting to unpack amazonka's Seconds into other time types, so I think it's okay for them to stick around.

@endgame endgame merged commit e77610e into brendanhay:main Dec 7, 2022
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.

Aeson should not be reexported
2 participants