transient-haskell / transient

A full stack, reactive architecture for general purpose programming. Algebraic and monadically composable primitives for concurrency, parallelism, event handling, transactions, multithreading, Web, and distributed computing with complete de-inversion of control (No callbacks, no blocking, pure state)
MIT License
630 stars 28 forks source link

Move console IO stuff to a separate module #50

Open harendra-kumar opened 7 years ago

harendra-kumar commented 7 years ago

I would suggest the following:

1) Move keep, option, input to a separate module, say Transient.ConsoleIO. We can possibly call the new module Transient.Input if there are more input methods to be covered. We can rename keep to something more appropriate like withConsole or withAsyncInput or interactive.

2) keep' and exit can stay in Base. But we can rename keep' to something more appropriate likewait or stayput.

agocorona commented 7 years ago

Yep I agree. Definitively the creation of Transient.ConsoleIO is necessary and later think about renaming. since I have a conference in which I present Transient at Lambda Conf at the end of this month it is better no to rename primitives.

Transient.Input is not as good as Trasient.ConsoleIO IMO, since there are other forms of input using widgets in axiom, for example.

rahulmutt commented 7 years ago

I would go as far as to keep a separate package. I'm thinking along the lines of having transient-base be the core TransientIO monad definition and implementation with all the building-block APIs async, parallel, etc. and backtracking/exception handling. Anything outside of the domain of core asynchronous primitives should be in the main transient package like console I/O, etc and the transient package can re-export all the main APIs from transient-base. How does that sound?

The reason why I suggest this is that you won't need to worry about the console when you build concurrent/distributed backends - the most common use case of transient besides using with axiom which also probably doesn't require console I/O for non-trivial applications?

agocorona commented 7 years ago

It sounds well. That's how things should be. I have to change the git repo and create a mega-repo. Now the impedance on creating more packages and make builds works and synchronise in travis, hackage and stackage and maybe in docker is a big barrier for creating more packages. I want to create at least another additional module for parsing, including code that I have scattered in transient-Move and Axiom.

First the law of least effort recommend to separate it in a different modules as a first step. Also the console code should be rewritten to eliminate STM since it is not justified for the work.