ouroboros-consensus-0.21.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

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.