-
Notifications
You must be signed in to change notification settings - Fork 217
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
Move Hash
type and related functions into separate module.
#2303
Conversation
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.
Seems reasonable to re-use the Hash type for monetary policy ID.
This will fix the circular dependency.
Moving more types to separate modules and not re-exporting from a single types module may help reduce compilation in future.
Looks fine, as long as it builds and passes stylish-haskell.
c2aac52
to
a0e92b9
Compare
This allows code to use the `Hash` type without having to incur a dependency on the `Primitive.Types` module, which is already very large and slow to recompile.
a0e92b9
to
378930d
Compare
Hash
type and related functions into dedicated module.Hash
type and related functions into separate module.
bors r+ |
2303: Move `Hash` type and related functions into separate module. r=jonathanknowles a=jonathanknowles # Issue Number Preparation for [ADP-347](https://jira.iohk.io/browse/ADP-347). # Overview This PR moves the `Hash` type and related functions to a separate module `Cardano.Wallet.Primitive.Types.Hash`. This allows code to use the `Hash` type without having to incur a dependency on the `Primitive.Types` module, which is already very large and slow to recompile. # Comments This PR doesn't re-export the `Hash` type from `Primitive.Types`. Although it would be convenient to be able to import everything from `Primitive.Types` in one go (with a qualified import), it would also create a compilation bottleneck, since anything that imported `Hash` from the `Primitive.Types` module would have to depend on everything required to build `Primitive.Types`. This PR follows the advice presented in [Keeping Compilation Fast](https://www.parsonsmatt.org/2019/11/27/keeping_compilation_fast.html) by Matt Parsons. Co-authored-by: Jonathan Knowles <[email protected]>
Build failed:
|
bors r+ |
Build succeeded: |
Issue Number
Preparation for ADP-347.
Overview
This PR moves the
Hash
type and related functions to a separate moduleCardano.Wallet.Primitive.Types.Hash
. This allows code to use theHash
type without having to incur a dependency on thePrimitive.Types
module, which is already very large and slow to recompile.Comments
This PR doesn't re-export the
Hash
type fromPrimitive.Types
.Although it would be convenient to be able to import everything from
Primitive.Types
in one go (with a qualified import), it would also create a compilation bottleneck, since anything that importedHash
from thePrimitive.Types
module would have to depend on everything required to buildPrimitive.Types
.This PR follows the advice presented in Keeping Compilation Fast by Matt Parsons.