-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(hugr-core): Unseal and make public the traits HugrInternals
and HugrMutInternals
#1122
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.
Looks good, just a question on making the internal
mod public.
@@ -3,6 +3,7 @@ | |||
pub mod hugrmut; | |||
|
|||
pub(crate) mod ident; | |||
pub mod internal; |
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.
Why does this need to be public? Is it because HugrMut
has HugrMutInternals
as a super trait? This is a shame.
If it must be public then I think we should not suppress the documentation.
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.
Leaving it private creates the same behaviour we currently have, where HugrView
/HugrMut
can only be implemented locally and the HugrMutInternals
methods are inaccessible to other crates.
Since this is an internal crate already, we can export the trait and use it in our other crates that require low-level access to the graph.
It may come useful when further splitting up this crate, but the immediate use is accessing HugrMutInternals::replace_op
for low-level rewriting in tket2
.
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.
Ah, I am confused, I had thought HugrMut
was previously private. I will fix the PR title.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1122 +/- ##
==========================================
+ Coverage 86.73% 86.78% +0.05%
==========================================
Files 90 91 +1
Lines 18556 18560 +4
Branches 18163 18167 +4
==========================================
+ Hits 16094 16107 +13
+ Misses 1615 1606 -9
Partials 847 847
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
HugrMut
trait in hugr-core
HugrMut
trait
I've taken the liberty of editing the commit title to be more interesting in release notes. Please revert if you disagree. |
Uhm, I'd rather say it adds |
HugrMut
traitHugrInternals
and HugrInternals
HugrInternals
and HugrInternals
HugrInternals
and HugrMutInternals
#1122 missed re-exporting some `pub use`s from `hugr_core::hugr`.
## 🤖 New release * `hugr`: 0.4.0 -> 0.5.0 * `hugr-cli`: 0.1.0 * `hugr-core`: 0.1.0 * `hugr-passes`: 0.1.0 <details><summary><i><b>Changelog</b></i></summary><p> ## `hugr` <blockquote> ## 0.5.0 (2024-05-29) ### Bug Fixes - Missing re-exports in `hugr::hugr` ([#1127](#1127)) - Set initial version of hugr-core to 0.1.0 ([#1129](#1129)) ### Features - [**breaking**] Remove `PartialEq` impl for `ConstF64` ([#1079](#1079)) - [**breaking**] Allow "Row Variables" declared as List<Type> ([#804](#804)) - Hugr binary cli tool ([#1096](#1096)) - [**breaking**] Move passes from `algorithms` into a separate crate ([#1100](#1100)) - [**breaking**] Disallow nonlocal value edges into FuncDefn's ([#1061](#1061)) - [**breaking**] Move cli in to hugr-cli sub-crate ([#1107](#1107)) - Add verbosity, return `Hugr` from `run`. ([#1116](#1116)) - Unseal and make public the traits `HugrInternals` and `HugrMutInternals` ([#1122](#1122)) ### Refactor - [**breaking**] No Ports in TypeRow ([#1087](#1087)) - Add a `hugr-core` crate ([#1108](#1108)) </blockquote> ## `hugr-core` <blockquote> ## 0.1.0 (2024-05-29) ### Bug Fixes - Set initial version of hugr-core to 0.1.0 ([#1129](#1129)) ### Features - [**breaking**] Move cli in to hugr-cli sub-crate ([#1107](#1107)) - Make internals of int ops and the "int" CustomType more public. ([#1114](#1114)) - Unseal and make public the traits `HugrInternals` and `HugrMutInternals` ([#1122](#1122)) ### Refactor - Add a `hugr-core` crate ([#1108](#1108)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/). --------- Co-authored-by: Agustin Borgna <[email protected]>
Exposes
HugrInternals
andHugrMutInternals
inhugr_core::hugr::internal
(but not inhugr
).Closes #1121