cmd_pprint :: String -> IP.IdrisParser (Either String Command)
cmd_pprint name = do
     fmt <- ppFormat
     IP.whiteSpace
     n <- fromInteger <$> IP.natural
     IP.whiteSpace
     t <- IP.fullExpr defaultSyntax
     return (Right (PPrint fmt n t))

    where
        ppFormat :: IP.IdrisParser OutputFmt
        ppFormat = (discard (IP.symbol "html") >> return HTMLOutput)
               <|> (discard (IP.symbol "latex") >> return LaTeXOutput)
cmd_pprint :: String -> IP.IdrisParser (Either String Command)
cmd_pprint name = do
     fmt <- ppFormat
     IP.whiteSpace
     n <- fromInteger <$> IP.natural
     IP.whiteSpace
     t <- IP.fullExpr defaultSyntax
     return (Right (PPrint fmt n t))

    where
        ppFormat :: IP.IdrisParser OutputFmt
        ppFormat = (discard (IP.symbol "html") >> return HTMLOutput)
               <|> (discard (IP.symbol "latex") >> return LaTeXOutput)
cmd_pprint name = do
     fmt <- ppFormat
     IP.whiteSpace
     n <- fromInteger <$> IP.natural
     IP.whiteSpace
     t <- IP.fullExpr defaultSyntax
     return (Right (PPrint fmt n t))

    where
        ppFormat :: IP.IdrisParser OutputFmt
        ppFormat = (discard (IP.symbol "html") >> return HTMLOutput)
               <|> (discard (IP.symbol "latex") >> return LaTeXOutput)