ouroboros-consensus-test-0.3.1.0: Tests of the consensus layer

Test.Util.Split

Synopsis

# Documentation

spanLeft ∷ ∀ x a b. (x → Either a b) → [x] → ([a], Maybe (b, [x])) Source #

The returned b is the first in the list.

INVARIANT The output data is a segmentation of the given list.

spanLeft' ∷ ∀ x a b. (x → Either a b) → [x] → ([a], Maybe (b, [x])) Source #

As spanLeft, but the [a] is reversed.

splitAtJust ∷ ∀ x b. (x → Maybe b) → Word64 → [x] → (Maybe ([x], b), [x]) Source #

The returned b is either the nth b or else the last in the given list.

INVARIANT The output data is a segmentation of the given list.