X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FFormat.hs;h=f017f5e6a81ef1093354d0efb9970948fae1d1a1;hb=4ff7f4b48f372e1cbea63873c5604ee3b4b56d09;hp=26319b737391e238f6e5c90ab1d9209054efa796;hpb=858129cb755aa09da2b7bd758efb8519f2c89103;p=Lucu.git diff --git a/Network/HTTP/Lucu/Format.hs b/Network/HTTP/Lucu/Format.hs index 26319b7..f017f5e 100644 --- a/Network/HTTP/Lucu/Format.hs +++ b/Network/HTTP/Lucu/Format.hs @@ -1,5 +1,3 @@ --- #hide - -- 本當にこんなものを自分で書く必要があったのだらうか。Printf は重いの -- で駄目だが、それ以外のモジュールを探しても見付からなかった。 @@ -25,9 +23,9 @@ fmtInt base upperCase minWidth pad forceSign n sign ++ padded where fmt' :: Int -> String - fmt' n - | n < base = (intToChar upperCase n) : [] - | otherwise = (intToChar upperCase $! n `mod` base) : fmt' (n `div` base) + fmt' m + | m < base = (intToChar upperCase m) : [] + | otherwise = (intToChar upperCase $! m `mod` base) : fmt' (m `div` base) fmtDec :: Int -> Int -> String @@ -125,4 +123,5 @@ intToChar True 13 = 'D' intToChar False 14 = 'e' intToChar True 14 = 'E' intToChar False 15 = 'f' -intToChar True 15 = 'F' \ No newline at end of file +intToChar True 15 = 'F' +intToChar _ _ = undefined