major <- many1 digit
char '.'
minor <- many1 digit
- return $ HttpVersion (read major) (read minor)
+ return $ HttpVersion (read' major) (read' minor)
+ where
+ read' "1" = 1 -- この二つが
+ read' "0" = 0 -- 壓倒的に頻出する
+ read' s = read s
hPutHttpVersion :: Handle -> HttpVersion -> IO ()