ip_str :: Parser String
ip_str = do
    q1 <- quad
    char '.'
    q2 <- quad
    char '.'
    q3 <- quad
    char '.'
    q4 <- quad
    return $ let dot = "."
             in concat [q1,dot,q2,dot,q3,dot,q4]
    where
        quad = choice [try $ count 3 digit,
                       try $ count 2 digit,
                       try $ count 1 digit]
ip_str :: Parser String
ip_str = do
    q1 <- quad
    char '.'
    q2 <- quad
    char '.'
    q3 <- quad
    char '.'
    q4 <- quad
    return $ let dot = "."
             in concat [q1,dot,q2,dot,q3,dot,q4]
    where
        quad = choice [try $ count 3 digit,
                       try $ count 2 digit,
                       try $ count 1 digit]
ip_str = do
    q1 <- quad
    char '.'
    q2 <- quad
    char '.'
    q3 <- quad
    char '.'
    q4 <- quad
    return $ let dot = "."
             in concat [q1,dot,q2,dot,q3,dot,q4]
    where
        quad = choice [try $ count 3 digit,
                       try $ count 2 digit,
                       try $ count 1 digit]