showTM' :: TransitionFunc -> InternalState -> Tape -> Integer -> IO ()
showTM' f q t n
	| label q == "END" = putStrLn $ "STEP " ++ show n ++ ": FINAL RESULT: " ++ show (current t : right t)
	| otherwise = do
		putStrLn $ "STEP " ++ show n ++ ": STATE: " ++ label q ++ " => " ++ show t
		let (q', t') = runTM f (q, t)
		showTM' f q' t' (n + 1)


-- the output tape from one TM is written as the input to the next, counting the total number of steps and returning the eventual result
-- TODO: replace the output of run with (Integer, Tape) so that actual composition will work.
showTM' :: TransitionFunc -> InternalState -> Tape -> Integer -> IO ()
showTM' f q t n
	| label q == "END" = putStrLn $ "STEP " ++ show n ++ ": FINAL RESULT: " ++ show (current t : right t)
	| otherwise = do
		putStrLn $ "STEP " ++ show n ++ ": STATE: " ++ label q ++ " => " ++ show t
		let (q', t') = runTM f (q, t)
		showTM' f q' t' (n + 1)


-- the output tape from one TM is written as the input to the next, counting the total number of steps and returning the eventual result
-- TODO: replace the output of run with (Integer, Tape) so that actual composition will work.
showTM' f q t n
	| label q == "END" = putStrLn $ "STEP " ++ show n ++ ": FINAL RESULT: " ++ show (current t : right t)
	| otherwise = do
		putStrLn $ "STEP " ++ show n ++ ": STATE: " ++ label q ++ " => " ++ show t
		let (q', t') = runTM f (q, t)
		showTM' f q' t' (n + 1)


-- the output tape from one TM is written as the input to the next, counting the total number of steps and returning the eventual result
-- TODO: replace the output of run with (Integer, Tape) so that actual composition will work.