-
Notifications
You must be signed in to change notification settings - Fork 15
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: add With() method based on with keywork from F# #44
Comments
Whilst this is in theory achievable, the only way I can think to do this would necessitate a lot of reflection use and so would be slow. I'd question whether it's worth it therefore when pattern-based |
@DavidArno Indeed, it would use reflection to create a new Immutable object and detect properties to overwrite. I can start with a PR until we have C# 8. |
PR's are always welcome 😀 |
Bit slow on the uptake here, but I have just realised that because this feature requires I am therefore pulling this feature from the v3.1 release and will reschedule it for the v4.0 release (which is allowed to make such breaking changes). Apologies for the last minute change of plan here. |
Renamed to TryWith and TryCopy With (version that throws exceptions rather than using an Option<T> type) added Various code changes to support edge-case badly behaved types
Good to know. I will have some time to make some adjustments on the feature so. |
@DavidArno For information, I have made the wiki page for Copy/With functions https://github.com/DavidArno/SuccincT/wiki/Copy---With |
(I think - it's been so many months since I've been near SuccincT, I may have missed something). Took advantage of the Deconstruct on the Success<T> type and modified various tests to use this. Found a bug in the process (the paramter name on the deconstruct was wrong, so this is now fixed.
Released with v4. |
It would be interesting to add immutable syntax using the
with
keyword from F#. Here is a proposal :The text was updated successfully, but these errors were encountered: