Copyright | (c) Eric Mertens 2021 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
validate :: String -> String -> Either Char String Source #
Either find the first unexpected bracket, or return the expected sequence of closing characters.
>>>
validate [] "{([(<{}[<>[]}>{[]{[(<()>"
Left '}'
>>>
validate [] "[({(<(())[]>[[{[]{<()<>>"
Right "}}]])})]"