question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could `Sequential` satisfy `SearchableList` ?

See original GitHub issue

I was experimenting with the in operator and "Hello" in "Hello world" lead me to try

print([1,2] in [0,1,2,3]);

which gave a warning “Tests containment with disjoint element types: ‘Integer[2]’ and ‘Integer’ are disjoint” and printed out false.

So after investigating, I found that SearchableList is involved in the substring search and wondered why Sequential couldn’t also support the same behaviour:

list-subtypes

Encouraged by @jvasileff I reposted my question here.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
jvasileffcommented, Mar 23, 2017

Would it make sense for all Sequentials to be Categorys of both their elements and their sublists?

One reason not to is that “their elements and their sublists” aren’t necessarily disjoint. There would be two occurrences of [1, 2] in [1, 2, [1, 2]], which seems confusing.

1reaction
gavinkingcommented, Mar 27, 2017

I don’t see any particularly strong reason why Sequential couldn’t inherit SearchableList<Anything>.

OTOH, I rarely use these operations, except on Strings, and they are actually somewhat heavy to implement.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are 3 conditions under which the sequential search of a ...
The list must be in sorted order. Any random element can be accessed in constant time. With linked list the second prerequisite is...
Read more >
Why is sequential search of ordered list slower than search of ...
I have got assignment to implement set class with linked list, so I first made it with unordered list and time needed to...
Read more >
Sequential search leads to faster, more efficient fragment ...
We have investigated whether a pseudo-greedy search approach, which begins sequentially from one of the termini, can improve the performance and accuracy of...
Read more >
Consumer Sequential Search: Not Enough or Too Much? - JStor
We study sequential search behavior in a generalized "secretary problem" in which a single object is to be selected from a set of...
Read more >
Sequential Search with Refinement: Model and Application ...
in the data, a consumer's decision to stop the search can be ... identification and estimation strategy of a sequential search model that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found