You can test Parsec interactively using ghci. To start, load the Text.Parsec module using the :m + command.
In the example below, we define a recursive parser parenSet that matches balanced parentheses and use the parse function to run it against input strings.
Right () indicates a successful parse.Left (line, column): error_message indicates a parse failure with location details.
Prelude> :m +Text.Parsec
Prelude Text.Parsec> let parenSet = char '(' >> many parenSet >> char ')' :: Parsec String () Char
Prelude Text.Parsec> let parens = (many parenSet >> eof) <|> eof
Prelude Text.Parsec> parse parens "" "()"
Right ()
Prelude Text.Parsec> parse parens "" "()(())"
Right ()
Prelude Text.Parsec> parse parens "" "("
Left (line 1, column 2):
unexpected end of input
expecting "(" or ")"