3 ms·
If you want to do this in practice rather than as a specialised example, I would suggest using something like Conduit, rather than reinventing the wheel. Condu
by A1kmm 14y ago
If you want to do this in practice rather than as a specialised example, I would suggest using something like Conduit, rather than reinventing the wheel.
Conduit is used widely in the Yesod web framework (for example, to implement the HTTP server), and could easily be hooked up to stdin and stdout for an interactive pure program.
Conduit internally looks like this: http://hackage.haskell.org/packages/archive/conduit/0.5.6/doc/html/Data-Conduit-Internal.html http://hackage.haskell.org/packages/archive/conduit/0.5.6/do...
- note that you get to choose an underlying monad m and run things in it using PipeM, but you could just make this the Identity monad.