>>>>> Alexey Raga <
alexe...@gmail.com> writes:
> I have a stateful consumer, let's say a counter:
> counter :: (Show a) => Consumer a (StateT Integer IO) ()
> counter = do
> x <- await
> lift $ S.modify (+1)
> liftIO $ print $ show x
> counter
> But how do I get the final state from it?
main :: IO ()
main = do
x <- flip S.execStateT 0 $ runEffect $ each [1,2,3,4,5,6] >-> counter
print x
John