@@ -26,11 +26,8 @@ import qualified Data.ByteString.UTF8 as UTF8
2626
2727parseCmd :: IState -> String -> String -> Result (Either String Command)
2828parseCmd i inputname = P.runparser pCmd i inputname . trim
29− where trim = fst . foldr f ("", True) . dropWhile isSpace
30− where f e (xs, False) = (e : xs, False)
31− f e (xs, True)
32− | isSpace e = (xs, True)
33− | otherwise = (e : xs, False)
29+ where trim = f . f
30+ where f = reverse . dropWhile isSpace
3431
3532type CommandTable = [ ( [String], CmdArg, String
3633 , String -> P.IdrisParser (Either String Command) ) ]