[lib] check discontinuity indicator, export isNextOf function.
[tsselect] use semigroup instead of monoid.