pipes-ordered-zip

merge two ordered Producers into a new Producer

https://github.com/githubuser/pipes-ordered-zip#readme

Version on this page:1.1.0
LTS Haskell 22.14:1.2.1
Stackage Nightly 2024-03-28:1.2.1
Latest on Hackage:1.2.1

See all snapshots pipes-ordered-zip appears in

BSD-3-Clause licensed by Stephan Schiffels
Maintained by [email protected]
This version can be pinned in stack with:pipes-ordered-zip-1.1.0@sha256:c4b25b596e2a3de4788e7944c3ceb83ed5384c975f6436d0bfb9ffa08625cc85,1324

Module documentation for 1.1.0

Depends on 3 packages(full list with versions):
Used by 1 package in nightly-2020-07-04(full list with versions):

pipes-ordered-zip

A function to tie together two sorted Haskell Iterators (Producers from the pipes library).

Example:

import Pipes (runEffect, (>->), each)
import qualified Pipes.Prelude as P
import Pipes.OrderedZip (orderedZip)

main = do
    let a = each [1,3,4,6,8] -- has to be ordered
        b = each [2,3,4,5,8] -- has to be ordered
    let mergedProd = orderedZip compare a b
    _ <- runEffect $ mergedProd >-> P.print
    return ()

prints:

(Just 1,Nothing)
(Nothing,Just 2)
(Just 3,Just 3)
(Just 4,Just 4)
(Nothing,Just 5)
(Just 6,Nothing)
(Just 8,Just 8)

Changes

  • Version 1.0.0.0: Initial commit with example, tests and haddock

  • Version 1.0.0.1: Added a note that input sequences have to be sorted.

  • V 1.1.0: Added new function to check ordering of incoming pipes