capture :: Action a -> Action ([NSIS], a)
capture (Action act) = Action $ do
    s0 <- get
    put s0{stream=[]}
    res <- act
    s1 <- get
    put s1{stream=stream s0}
    return (stream s1, res)
capture :: Action a -> Action ([NSIS], a)
capture (Action act) = Action $ do
    s0 <- get
    put s0{stream=[]}
    res <- act
    s1 <- get
    put s1{stream=stream s0}
    return (stream s1, res)
capture (Action act) = Action $ do
    s0 <- get
    put s0{stream=[]}
    res <- act
    s1 <- get
    put s1{stream=stream s0}
    return (stream s1, res)