char :: Char -> LParser Char
char c = ParseEither (char' c)
  where
    char' :: Char -> [L] -> Either (Error, [L]) (Char, [L])
    char' c (Token (c' : cs) : ts) | c == c' = Right (c, Token cs : ts)
    char' c s@(Token [] : ts) = err s
    char' c s = err s
    err s = Left ("expected char: " ++ [c], s)
char :: Char -> LParser Char
char c = ParseEither (char' c)
  where
    char' :: Char -> [L] -> Either (Error, [L]) (Char, [L])
    char' c (Token (c' : cs) : ts) | c == c' = Right (c, Token cs : ts)
    char' c s@(Token [] : ts) = err s
    char' c s = err s
    err s = Left ("expected char: " ++ [c], s)
char c = ParseEither (char' c)
  where
    char' :: Char -> [L] -> Either (Error, [L]) (Char, [L])
    char' c (Token (c' : cs) : ts) | c == c' = Right (c, Token cs : ts)
    char' c s@(Token [] : ts) = err s
    char' c s = err s
    err s = Left ("expected char: " ++ [c], s)