I am looking for an efficient indexed persistent data structure. I usually work in .NET and I know about FSharp Map, however this implementation and most of the others that I know about provide only one “index”, the left side of the display.
Basically a script here
public class MyObject
public int Id { get; }
public int GroupId { get; }
public string Name { get; }
If the object identifier will be a globally unique set of added elements. GroupId can have duplicate values, and I want to be able to query all the values using the corresponding GroupId, and within the GroupId names will be unique, but can be duplicated in different GroupId. This is not a situation where I can simply create a composite key of three fields, because I need independent access to groups of elements based on certain field values.
I can do this and in the past use dictionaries of dictionaries that were recommended in other posts here in STackoverflow ... however I also want the data structure to be 1) Completely persistent and all that means 2) memory efficiency - that means that versions should have as many nodes as possible 3) effective in modifications - I would like it to be fast
I understand that I ask very little here, but I wanted to ask to avoid even trying to reinvent the wheel, if it has already been done.
thanks
source
share