Gabriel439/Haskell-Pipes-Library — pull request #96 by Davorak (2013-10-25 12:44:57+00:00)
Title: Simple lift

I have gotten rid of all of the dependancies on Pipes.Prelude. The run/eval/exec functions are not as polymorphic as they are in the current Pipes.Lift.

In includes both unidirectional and bidirectional varieties, the suffix B is used for the bidirectional.

I rewrote catchError, by lifting the function from Control.Monad.Trans.Error with runSubPipeT. Most functions are straight forward to lift in this fashion. The type signature has changed so you might want to look it over more closely. It now more closely follows the catchError for Transformers since it is lifted pretty much pretty much mechanically.

current catchError:
catchError
:: (Monad m)
=> Proxy a' a b' b (E.ErrorT e m) r
-- ^
-> (e -> Proxy a' a b' b (E.ErrorT f m) r)
-- ^
-> Proxy a' a b' b (E.ErrorT f m) r
catchError p0 f = go p0
where
go p = case p of
Request a' fa -> Request a' (\a -> go (fa a ))
Respond b fb' -> Respond b (\b' -> go (fb' b'))
Pure r -> Pure r
M m -> M (E.ErrorT (do
x <- E.runErrorT m
return (Right (case x of
Left e -> f e
Right p' -> go p' )) ))

new catchError:

catchError
:: (Monad m, E.Error e)
=> Proxy a' a b' b (E.ErrorT e m) r
-- ^
-> (e -> Proxy a' a b' b (E.ErrorT e m) r)
-- ^
-> Proxy a' a b' b (E.ErrorT e m) r
catchError e h = errorP . E.runErrorT $
E.catchError (runSubPipeT e) (runSubPipeT . h)

Given the above it looks ready for a merge. I have check the following packages for compatibility.

The current packages from hackage packages are compatible:
DirStream-Library
pipes-attoparsec-0.3.0
Haskell-Pipes-ByteString-Library
pipes-network-0.6.0
Haskell-Pipes-Concurrency-Library
pipes-parse-2.0.0
Haskell-Pipes-Library
pipes-vector-0.5.2
Haskell-Pipes-Parse-Library
pipes-zlib-0.3.0
Haskell-Pipes-Safe-Library
pipes-aeson-0.2.0