failback monad

1
2
3
4
5
6
7
8
9
test= runBackT $ do
       lift $ print "will not return back here"
        liftRepeat $ print "will return here"
        n2 <- lift $ getLine
        lift $ print "second input"
        n3  <- lift $  getLine
        if n3 == "back"
                   then  fail ""
                   else lift $ print  $ n2++n3