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

[ bioinformatics, bsd3, library ] [ Propose Tags ]

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 [faq] 1.0.0.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 Tue Mar 5 13:45:36 UTC 2019
Distributions NixOS:1.0.0.1
Downloads 54 total (5 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-03-05 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for pipes-ordered-zip-1.0.0.1

[back to package description]

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)