I\'m attempting to implement a simple web server with Haskell and the Pipes library. I understand now that cyclic or diamond topologies aren\'t possible wi
I have not run your code, but I think I spotted a problem.
routeRequest'' = runProxyK $ routeRequest''' <-< unitU
routeRequest'''
is requesting data from unitU which has nothing to supply, so it hangs.
:t runProxy $ unitU >-> printD
Will type check but nothing runs.
It seems like the data is being sent to the wrong level of the monad transformer, data which is flowing into routeRequest
should be flowing into routeRequest'''
. The data flowing into the wrong level of the monad transformer is what is probably causing you to need to leave of the type signature to get everything to type check. With the type signature routeRequest
is expecting a ()
coming from upstream and, I bet, with no type signature it is allowed to be polymorphic.
In your definition of routeRequest
you could "close the pipe", I think that is what it is called, by using unitD which would disallow your construction even when routeRequest'''
does not have the type signature.