Portably opening a handle to stdin many times in a single session
问题 Code: main = do putStrLn "4917 Microprocessor\nEnter the Machine Code to be run: " inp <- getContents putStrLn "The output of the Program is:" fState <- ((runStateT _4917) . construct . parse) inp args <- getArgs if elem "-v" args then putStrLn ("\nFinal state was: " ++ (show . snd) fState) else return () putStrLn "\n================================ RESTART ================================" main where parse xs = array (0,15) $ zip [0..15] $ take 16 $ map ((makeArbInt 4) . read) (words (filter