fslaborg / Graphoscope

A pragmatic approach to network science.
http://fslab.org/Graphoscope/
MIT License
14 stars 6 forks source link

Immutability when consuming FGraph #45

Open HarryMcCarney opened 1 year ago

HarryMcCarney commented 1 year ago

Might be a matter of taste but when using FSX files I find immutability very helpful.

Should we update operations like removeNode to create, update and return a copy of the passed in graph.

This keeps the usage closer to a functional F# style and removes cognitive overhead of mutating objects in scope of interactive sessions. Any thoughts?

muehlhaus commented 1 year ago

I completely agree. We should move all functions that mutate the graph in a module named 'InPlace' or add 'InPLace' as a suffix to the function name.

The function with classical naming should always return a copy.