Thanks David,
Right - it invokes its iter repeatedly because mkInumC does that and mkInum is
defined as:
mkInum = mkInumC id noCtl
So to do it all manually is:
inumReverseLines :: (Monad m) = Inum L.ByteString L.ByteString m a
inumReverseLines = mkInumM $ loop where
loop = do
eof -
Hi Hakell Cafe,
I'm struggling to understand my unambitious IterIO code that somehow manages
to work.
Basically I run an echo server that is supposed to read from a socket line
by line and write back to the socket with all the characters in the line
reversed:
import Control.Exception
import
On Thu, Jun 30, 2011 at 09:53, John Ky newho...@gmail.com wrote:
enum |$ inumReverseLines .| iter
inumReverseLines = mkInum $ do
line - lineI
return (L.reverse (L.concat [line, C.pack \n]))
No attempt was made to reverse more than one line - at least as far as I can
see. What have I
At Thu, 30 Jun 2011 23:53:02 +1000,
John Ky wrote:
But all I've done is:
enum |$ inumReverseLines .| iter
inumReverseLines = mkInum $ do
line - lineI
return (L.reverse (L.concat [line, C.pack \n]))
mkInum repeatedly invokes its iter argument so as to keep