21 lines
445 B
Haskell
21 lines
445 B
Haskell
module Commons where
|
|
|
|
import System.IO
|
|
import Text.Read
|
|
|
|
type CalibrationLine = String
|
|
|
|
type CalibrationDocument = [CalibrationLine]
|
|
|
|
parseLine :: IO CalibrationLine
|
|
parseLine = do line <- getLine
|
|
return line
|
|
|
|
parse :: IO CalibrationDocument
|
|
parse = do done <- isEOF
|
|
if done
|
|
then return []
|
|
else do line <- parseLine
|
|
doc <- parse
|
|
return (line:doc)
|