Skip to content

Conversation

@ColmBhandal
Copy link
Owner

Description

Added some enhancements to dictionaries covering some outstanding issues, including:

  • Converting arrays to dictionaries
  • Adding partial wrapper types for dictionaries to achieve covariance/contraviariance

/// <summary>
/// Converts this array to a reverse list-based dictionary
/// </summary>
public static IListValuedDictionary<TVal, int> ConvertToReverseListValuedDictionary<TVal>(this TVal[] array, int indexOffset)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to add overrides for these functions that default the offset to 0. I think it's great that you support it, but I don't see many cases where they would be used (aside from one-based arrays, but they probably should implement a version of this that automatically sets the offset to 1 to avoid confusion).

ISuccessTuple<V> TryGetValue(K key);
}

public interface ISuccessTuple<out V>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to split this into its own file. Same for the implementation class below.

Some minor code tidying
Parametrised some tests
@ColmBhandal ColmBhandal merged commit b76d495 into develop Jul 6, 2020
@ColmBhandal ColmBhandal deleted the feature/dictionary-enhancements branch July 6, 2020 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants