{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE StandaloneDeriving #-}
module Parser.Line_and_char (L (..), Line_and_char, init_line_and_char, next_char, next_line, write_line_and_char) where
data L t = L Line_and_char t
data Line_and_char = Line_and_char Integer Integer
deriving instance Eq Line_and_char
deriving instance Ord Line_and_char
deriving instance Show t => Show (L t)
deriving instance Show Line_and_char
init_line_and_char :: Line_and_char
init_line_and_char :: Line_and_char
init_line_and_char = Integer -> Integer -> Line_and_char
Line_and_char Integer
1 Integer
1
next_char :: Line_and_char -> Line_and_char
next_char :: Line_and_char -> Line_and_char
next_char (Line_and_char Integer
line Integer
char) = Integer -> Integer -> Line_and_char
Line_and_char Integer
line (Integer
1 Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
char)
next_line :: Line_and_char -> Line_and_char
next_line :: Line_and_char -> Line_and_char
next_line (Line_and_char Integer
line Integer
_) = Integer -> Integer -> Line_and_char
Line_and_char (Integer
1 Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
+ Integer
line) Integer
1
write_line_and_char :: Line_and_char -> String
write_line_and_char :: Line_and_char -> String
write_line_and_char (Line_and_char Integer
line Integer
char) = Integer -> String
forall a. Show a => a -> String
show Integer
line String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
":" String -> ShowS
forall a. [a] -> [a] -> [a]
++ Integer -> String
forall a. Show a => a -> String
show Integer
char