Repository navigation
Implement "copy" functionality for FGraph #52
Copy link
Copy link
Open
Labels
Difficulty: IntermediateHackathon projects with intermediate difficultyHackathon projects with intermediate difficultyFsLab Hackathon 2023Implementation projects for the 2023 FsLab HackathonImplementation projects for the 2023 FsLab HackathonStatus: In ProgressenhancementNew feature or requestNew feature or request
Milestone
Description
Activity
- addedenhancementNew feature or requestNew feature or requestDifficulty: IntermediateHackathon projects with intermediate difficultyHackathon projects with intermediate difficultyFsLab Hackathon 2023Implementation projects for the 2023 FsLab HackathonImplementation projects for the 2023 FsLab Hackathon
on Sep 25, 2023 I'll be working on this one
Reacted by Kevin SchneiderThe implementation is a shared effort from myself and @yigitl.
We now have an implementation that creates clones of undirected graphs.
Currently, the function will create a deep copy if the NodeData/EdgeData generics are value types, and it will create a shallow copy if these are reference types.
This implementation should be revised after a decision on how to handle EdgeData/NodeData generics. There are three ways of handling these generics:
- Enforce
IClonable, so that the user has to use data types that implement_.Clone(), or implement_.Clone()for their own data types. - Constraint these generics to be value types. This means that records should have
[<Struct>]flag. - Do nothing, just tell the user is cloning might not work if the generics are reference types.
Implementation of these options is relatively trivial and can be applied as soon as a decision has been reached.
Reacted by DoganCK, Christopher Lux and Benedikt Venn- Enforce
- added a commit that references this issue
on Sep 30, 2023 - added a commit that references this issue
on Sep 30, 2023
Metadata
Metadata
Assignees
Labels
Difficulty: IntermediateHackathon projects with intermediate difficultyHackathon projects with intermediate difficultyFsLab Hackathon 2023Implementation projects for the 2023 FsLab HackathonImplementation projects for the 2023 FsLab HackathonStatus: In ProgressenhancementNew feature or requestNew feature or request
Type
Projects
- StatusShow more project fieldsNo status
Description
Our ultimate goal is to leave the decision to use mutation or not to the user. Mutation makes sense for heavy duty operations that run on the cloud. But while developing and working with smaller graphs mutation gets in the way and can be unwieldy to use. The initial step for this is to have a deep copy functionality.
Pointers
https://learn.microsoft.com/en-us/dotnet/api/system.object.memberwiseclone?view=net-7.0