1 2module Util where 3 4import Text.Parsec 5import Text.Parsec.String ( Parser ) 6 7-- | Returns the error messages associated 8-- with a failed parse. 9parseErrors :: Parser a -> String -> [String] 10parseErrors p input = 11 case parse p "" input of 12 Left err -> 13 drop 1 $ lines $ show err 14 Right{} -> [] 15