teakO :: [(Int, TeakOTerm)] -> Chan -> Chan -> MkPNMonad SimFlow SimValue ()
    teakO terms ((inpR, inpA), _) (_, (outR, outA)) = withLabel "O" $ do
        when (not isStop) $ do
            withLabel "r" $ newTrans [inpR] [outR] [PNOp terms (PNInput 0)]
            return ()
        withLabel "a" $ newTrans [outA] [inpA] [PNLiteral token]
        return ()
        where
            isStop = case last terms of
                (_, TeakOBuiltin { teakOBuiltin = "BalsaSimulationStop" }) -> True
                _ -> False
teakO :: [(Int, TeakOTerm)] -> Chan -> Chan -> MkPNMonad SimFlow SimValue ()
teakO terms ((inpR, inpA), _) (_, (outR, outA)) = withLabel "O" $ do
        when (not isStop) $ do
            withLabel "r" $ newTrans [inpR] [outR] [PNOp terms (PNInput 0)]
            return ()
        withLabel "a" $ newTrans [outA] [inpA] [PNLiteral token]
        return ()
        where
            isStop = case last terms of
                (_, TeakOBuiltin { teakOBuiltin = "BalsaSimulationStop" }) -> True
                _ -> False
teakO terms ((inpR, inpA), _) (_, (outR, outA)) = withLabel "O" $ do
        when (not isStop) $ do
            withLabel "r" $ newTrans [inpR] [outR] [PNOp terms (PNInput 0)]
            return ()
        withLabel "a" $ newTrans [outA] [inpA] [PNLiteral token]
        return ()
        where
            isStop = case last terms of
                (_, TeakOBuiltin { teakOBuiltin = "BalsaSimulationStop" }) -> True
                _ -> False