lineNumberP :: Parser LineNumber
lineNumberP = choice [lineEOF, lineNumber]
  where
    lineNumber = do
      n <- read <$> many digit
      return (LineNumber (n - 1))
    lineEOF = char '$' >> return EndOfFile
lineNumberP :: Parser LineNumber
lineNumberP = choice [lineEOF, lineNumber]
  where
    lineNumber = do
      n <- read <$> many digit
      return (LineNumber (n - 1))
    lineEOF = char '$' >> return EndOfFile
lineNumberP = choice [lineEOF, lineNumber]
  where
    lineNumber = do
      n <- read <$> many digit
      return (LineNumber (n - 1))
    lineEOF = char '$' >> return EndOfFile