Open palday opened 2 years ago
While I'm definitely sympathetic to this (I've wanted it for quite some time), it was purposefully excluded. See https://github.com/beacon-biosignals/TimeSpans.jl/pull/5#discussion_r573117667.
Note also that as implemented, this constitutes a breaking change; it will no longer Just Work™ for arbitrary arguments that implement start
and stop
.
I wonder if there's a different verb we can use so that have our cake and eat too, so to speak, i.e. we can leave the arguments untyped for fans of duck typing and also export without conflicting with a Base function. Could be worth an issue to discuss.
If we want to keep using contains
as a verb we can always declare our own function (like we were doing) but also fall back on Base
for other cases.
TimeSpans.contains(a::TimeSpan, b::Union{TimeSpan,Period}) = ...
TimeSpans.contains(a, b) = Base.contains(a, b)
This allows users to opt-in to the TimeSpans
change but not have to always qualify their usage.
extend
Base.contains
using a precise type signature so thatcontains
can be used without qualification. No need to export something fromBase
.