pipes-ordered-zip: merge two ordered Producers into a new Producer

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

provides a simple function to merge two Pipes-Producers into a new Producer that yields pairs of values of the original producers, but using Maybes to indicate values that are only present in the first, second or both producers. Useful to perform Left-Joins, Right-Joins and Inner-Joins on the fly using Haskell Pipes.

[Skip to Readme]


Versions,, 1.0.1, 1.1.0, 1.2.0, 1.2.1
Change log Changelog.md
Dependencies base (>=4.7 && <5), pipes (>=4.3.9 && <4.4) [details]
License BSD-3-Clause
Copyright 2019 Stephan Schiffels
Author Stephan Schiffels
Maintainer stephan_schiffels@mac.com
Category Bioinformatics
Home page https://github.com/githubuser/pipes-ordered-zip#readme
Uploaded by stephan_schiffels at 2019-03-05T13:45:03Z


[Index] [Quick Jump]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Readme for pipes-ordered-zip-

[back to package description]


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


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 ()


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