lexFile :: String -> Either Error [[L]]
lexFile = mapM step . zip [1..] . lines
  where
    step (i, l) =
      case lexLine l of
        Left err -> Left ("line " ++ show i ++": " ++ err)
        Right v -> Right v
lexFile :: String -> Either Error [[L]]
lexFile = mapM step . zip [1..] . lines
  where
    step (i, l) =
      case lexLine l of
        Left err -> Left ("line " ++ show i ++": " ++ err)
        Right v -> Right v
lexFile = mapM step . zip [1..] . lines
  where
    step (i, l) =
      case lexLine l of
        Left err -> Left ("line " ++ show i ++": " ++ err)
        Right v -> Right v