Copyright | 2013-2018 Luis Pedro Coelho |
---|---|
License | MIT |
Maintainer | luis@luispedro.org |
Safe Haskell | None |
Language | Haskell2010 |
Simple algorithms packaged as Conduits
Documentation
uniqueOnC :: (Ord b, Monad m) => (a -> b) -> Conduit a m a Source #
Unique conduit.
For each element, it checks its key (using the a -> b
key function) and
yields it if it has not seen it before.
Note that this conduit does not assume that the input is sorted. Instead
it uses a Set
to store previously seen elements. Thus, memory usage
is O(N) and time is O(N log N). If the input is sorted, you can use
removeRepeatsC