-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Nodes::Node
s to hold arbitrary value
s
#85
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gonzedge
force-pushed
the
gonzedge/trie-nodes-with-arbitrary-values
branch
from
December 8, 2024 04:14
50684fa
to
063fd26
Compare
- `Nodes::Node#value` - `Container#add` and `Container#concat`; updated the `add_word` spec helpers. - `Compressor#compress`
- Add `value` attribute to `Nodes::Node` with new `TValue` type - Allow `TValue` to be `nil` by default with `?` - Require `TValue` to implement `_Inspect` built-in(!) interface, for `Inspectable` module - Change all types that depend on `Nodes::Node` also have the generic type `TValue < _Inspect` including static methods - Add optional `TValue` argument to `Container#add`, `Nodes::Node#add`, and `Nodes::Raw#add_to_children_tree` - Add optional `Array[TValue?]` argument to `Container#concat` - Add new `|| raise`s because the inline type conversion to non-nil doesn't work anymore 🤷🏻♂️
gonzedge
force-pushed
the
gonzedge/trie-nodes-with-arbitrary-values
branch
from
December 8, 2024 04:16
063fd26
to
e196071
Compare
- Change `ProviderCollection#[]` to return TProvider? - Change `Nodes::Node#[]` to return Nodes::Node[TValue]? - Change `Container#[]` to return Nodes::Node[TValue]? - Add type annotations for `UnannotatedEmptyCollection`s - Raise `InvalidOperation`s when `compress(child)` return nil value which is not supposed to be possible
Code Climate has analyzed commit b9fcac1 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (95% is the threshold). This pull request will bring the total coverage in the repository to 100.0% (0.0% change). View more on Code Climate. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow
Nodes::Node
s to hold arbitraryvalue
s! Now, you can have a terminal node that on top of representing its word, it can hold on tovalue
attribute toNodes::Node
value
argument toContainer#add
,Nodes::Node#add
value
in terminal node viaNodes::Raw#add
andNodes::Raw#add_to_children_tree
, when presentCompressor#merge
andCompressor#compress_children_and_copy
to storevalue
fromNodes::Raw
in theterminal
Nodes::Compressed
, when presentvalues
array argument toContainer#concat
corresponding 1:1 towords
, that passes each word andvalue to
#add
when presentvalue
toInspectable#inspect
output, when presentTValue
toNodes::Node
type signature_Nilable
interface to own top-level filevalue
attribute inNodes::Node
use the newTValue
generic typeTValue
to benil
by default with?
TValue
to implement_Inspect
built-in(!) interface, forInspectable
moduleNodes::Node
also have the generic typeTValue < _Inspect
including static methods
TValue
argument toContainer#add
,Nodes::Node#add
, andNodes::Raw#add_to_children_tree
Array[TValue?]
argument toContainer#concat
|| raise
s because the inline type conversion to non-nil doesn't work anymore forsteep
check 🤷🏻♂rbs
v3.7.0
andsteep
v1.9.0
ProviderCollection#[]
to return TProvider?Nodes::Node#[]
to return Nodes::Node[TValue]?Container#[]
to return Nodes::Node[TValue]?UnannotatedEmptyCollection
sInvalidOperation
s whencompress(child)
return nil value which is not supposed to be possible