[Haskell-cafe] Combine `StateT` and `InputT` to maintain state on Ctrl-C interrupt

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Wed Aug 12 15:49:12 UTC 2015


On Wed, Aug 12, 2015 at 04:15:33PM +0100, Tom Ellis wrote:
> On Wed, Aug 12, 2015 at 04:26:59PM +0200, haskell at stefan-klinger.de wrote:
> > Version two: `InputT` inside `StateT`
> > 
> > > main :: IO ()
> > > main = runInputT defaultSettings . noesc $ evalStateT repl 0
> 
> Instead of this, how about `hoist`ing noesc inside the StateT?

Actually, thinking about it some more I think this is a more fiddly problem
that the like of

    http://hackage.haskell.org/package/MonadCatchIO-transformers-0.3.0.0/docs/Control-Monad-CatchIO.html

exist to solve, but I'm not so familiar with that kind of thing myself.

Tom


More information about the Haskell-Cafe mailing list