[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:16:43 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?

hoist is here:

    http://haddock.stackage.org/lts-2.22/mmorph-1.0.4/Control-Monad-Morph.html#v:hoist


More information about the Haskell-Cafe mailing list