I have this conduit expression which works:
main1 = runResourceT
$ CB.sourceHandle stdin
$$ CB.lines
=$ Cl.concatMap matches
=$ Cl.mapMaybe readDouble
=$ Cl.map fst
=$ Cl.map bucket
=$ Cl.map (BS.pack . show)
=$ Cl.map (\x -> x <> BS.pack "\n")
=$ CB.sinkHandle stdout
I'm having trouble splitting it up into two pieces, i.e. something like:
source = CB.sourceHandle stdin
$$ CB.lines
=$ Cl.concatMap matches
=$ Cl.mapMaybe readDouble
=$ Cl.map fst
=$ Cl.map bucket
sink = Cl.map (BS.pack . show)
=$ Cl.map (\x -> x <> BS.pack "\n")
=$ CB.sinkHandle stdout
so that I can use:
runResourceT $ source =$ sink
or whatever... The error message I get from the type-checker is somewhat inscrutable.