parseLength :: Parsec String () (Rational, String)
parseLength = do
    neg <- option "" ((:[]) <$> char '-')
    dec <- many1 digit
    frac <- option "" ((:) <$> char '.' <*> many1 digit)
    unit <- getInput
    -- This is safe as dec and frac must be a double of some kind
    let [(n :: Double, [])] = reads (neg ++ dec ++ frac) :: [(Double, String)]
    return (round (n * 18) % 18, unit)
parseLength :: Parsec String () (Rational, String)
parseLength = do
    neg <- option "" ((:[]) <$> char '-')
    dec <- many1 digit
    frac <- option "" ((:) <$> char '.' <*> many1 digit)
    unit <- getInput
    -- This is safe as dec and frac must be a double of some kind
    let [(n :: Double, [])] = reads (neg ++ dec ++ frac) :: [(Double, String)]
    return (round (n * 18) % 18, unit)
parseLength = do
    neg <- option "" ((:[]) <$> char '-')
    dec <- many1 digit
    frac <- option "" ((:) <$> char '.' <*> many1 digit)
    unit <- getInput
    -- This is safe as dec and frac must be a double of some kind
    let [(n :: Double, [])] = reads (neg ++ dec ++ frac) :: [(Double, String)]
    return (round (n * 18) % 18, unit)