Predicate span (source code)

= Predicate span

Splitting a <list> into its longest initially accepted <list prefix> and the remaining <list suffix>. On finite total <lists> with terminating <predicate> tests, the pair is a direct <right fold>: the true branch prepends to the first component; the false branch reconstructs the original tail by concatenating the two tail components and puts the current head before it. The richer pair result retains information that a direct dropped-<list suffix> <list fold> loses. Conventional recursive span is strict in the input spine; a literal pair of its two projections can expose an outer pair even on bottom, so partial-value equations require care.