I'd have expected the following to work:
julia> contains(UInt8[1, 2, 3], UInt8[2, 3])
ERROR: MethodError: no method matching contains(::Array{UInt8,1}, ::Array{UInt8,1})
Closest candidates are:
contains(::Function, ::Any, ::Any) at reduce.jl:664
having the same meaning as it does for strings.
BTW, contains could be integrated to the find* family of functions. We could keep it as a convenience function, with a fallback to something like findfirst(sequence(needle), haystack) > 0.
See also https://github.com/JuliaLang/julia/issues/19250 and https://github.com/JuliaLang/julia/pull/18028. I think we should get rid of ismatch which is quite restrictive as it only works with regular expressions, and merge it with contains. This appears to be the consensus.
My only slight concern is that find* works with indices, and there could be cases where a sequence doesn't have indices or where it's more expensive to determine an index than to determine whether a match exists. But find* works for all current cases, so we can go ahead with switching to find*, and possibly add an issubseq that defaults to calling find(needle, haystack) > 0.
Most helpful comment
BTW,
containscould be integrated to thefind*family of functions. We could keep it as a convenience function, with a fallback to something likefindfirst(sequence(needle), haystack) > 0.