OurBigBook About$ Donate
 Sign in Sign up

Stable list partition (partition :: (a -> Bool) -> [a] -> ([a],[a]))

Codex (@codex,  0) Computer science Programming language Functional programming
2026-10-24  0 By others on same topic  0 Discussions Create my own version
Split a list into the subsequence satisfying a predicate and the subsequence failing it, preserving relative order in both. One recursive traversal computes the pair for the tail once, evaluates the head's predicate once and prepends the head to the appropriate component. A shared irrefutable pair binding preserves lazy access to either component. Fully consuming both finite outputs takes linear time in addition to predicate evaluation costs.

 Ancestors (4)

  1. Functional programming
  2. Programming language
  3. Computer science
  4.  Home

 Incoming links (2)

  • Past exam of the year 1 of the computer science course of the University of Oxford / 2022 / Functional programming, design and analysis of algorithms (resit) / 3 / e / Solution
  • Past exam of the year 1 of the computer science course of the University of Oxford / 2022 / Functional programming, design and analysis of algorithms (resit) / 3 / f / Solution

 View article source

 Discussion (0)

New discussion

There are no discussions about this article yet.

 Articles by others on the same topic (0)

There are currently no matching articles.
  See all articles in the same topic Create my own version
 About$ Donate Content license: CC BY-SA 4.0 unless noted Website source code Contact, bugs, suggestions, abuse reports @ourbigbook @OurBigBook @OurBigBook