getCommand :: Editor b Command
getCommand = io $ readCom <$> getLine
  where
    readCom ""        = Noop
    readCom inp@(c:cs) | isDigit c = maybe Noop Line (readMay inp)
                       | toUpper c == 'L' = Load (unwords $ words cs)
                       | c == '?' = Help
                       | otherwise = maybe Noop read $
                                       find ((== toUpper c) . head) commands
getCommand :: Editor b Command
getCommand = io $ readCom <$> getLine
  where
    readCom ""        = Noop
    readCom inp@(c:cs) | isDigit c = maybe Noop Line (readMay inp)
                       | toUpper c == 'L' = Load (unwords $ words cs)
                       | c == '?' = Help
                       | otherwise = maybe Noop read $
                                       find ((== toUpper c) . head) commands
getCommand = io $ readCom <$> getLine
  where
    readCom ""        = Noop
    readCom inp@(c:cs) | isDigit c = maybe Noop Line (readMay inp)
                       | toUpper c == 'L' = Load (unwords $ words cs)
                       | c == '?' = Help
                       | otherwise = maybe Noop read $
                                       find ((== toUpper c) . head) commands