Skip to content

Conversation

@ColmBhandal
Copy link
Owner

Description

Added curry dictionary type and tests. This dictionary type nested dictionaries using tuples of keys and allows currying i.e. applying only a prefix of the keys or checking a prefix of keys for existence. The advantage is that prefixes can be queried with a complexity that is linear in the size of the key tuples only, but is constant w.r.t. the number of entries in the dictionary.

@ColmBhandal ColmBhandal linked an issue Jan 29, 2021 that may be closed by this pull request
C# 9 only supported by .NET 5 and above
Returning null tuple instead of tuple containing default
Default causes a warning due to potential nullability

Fixed bug in FindFirstOccurrenceOfSet for ArrayExtension - indices were zero based and were indexing up to length

Note - FindFirstOccurrenceOfSet is different for OneBased vs. ZeroBased arrays
For one-based, it is inclusive of both upper and lower bounds
For zero-based, it excludes the upper bound
IOneBasedArray<TVal> ZipMulti<TOther>(Func<TVal, TOther, TVal> zipper, IOneBasedArray<TOther> other, params IOneBasedArray<TOther>[] extras);
(int index, TVal element) FindFirstOccurrenceOfSet(ISet<TVal> set);
(int index, TVal element) FindFirstOccurrenceOfSet(ISet<TVal> set, int startIndex, int endIndex);
(int index, TVal element)? FindFirstOccurrenceOfSet(ISet<TVal> set);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add this breaking change to the CHANGELOG file.

Moved changelog entry to correct location
Did some renaming
Fixed minor inconsistency in FindFirstOccurrenceOfSet by removing +1
Removed unimiplemented setter property on curry dictionary
Need to add 1 when forwarding to other overload because upper bound is now exclusive
@ColmBhandal ColmBhandal merged commit b95c319 into develop Jan 29, 2021
@ColmBhandal ColmBhandal deleted the feature/curry-dictionary branch January 29, 2021 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Curry Map

3 participants