charMatch :: (Char -> Bool) -> Parser Char
charMatch f = Parser charParser
  where charParser (c:r) | f c = Right (c, r)
                         | otherwise = Left $ "Predicate does not match at: " ++ head (lines (c:r))
        charParser "" = Left "Empty input"
charMatch :: (Char -> Bool) -> Parser Char
charMatch f = Parser charParser
  where charParser (c:r) | f c = Right (c, r)
                         | otherwise = Left $ "Predicate does not match at: " ++ head (lines (c:r))
        charParser "" = Left "Empty input"
charMatch f = Parser charParser
  where charParser (c:r) | f c = Right (c, r)
                         | otherwise = Left $ "Predicate does not match at: " ++ head (lines (c:r))
        charParser "" = Left "Empty input"