X-Git-Url: http://gitweb.michael.orlitzky.com/?p=hath.git;a=blobdiff_plain;f=src%2FOctet.hs;h=6d6c8c85f79265ab95eb6013082a8ef61c4af5ee;hp=c472f8da6e8c85552c32256f5409e0daeb86c5b8;hb=cca5aba75c313151878a98344c289827c94151e7;hpb=a5dfa1fd4dde2d79f42c606a56b4aea303d273e8 diff --git a/src/Octet.hs b/src/Octet.hs index c472f8d..6d6c8c8 100644 --- a/src/Octet.hs +++ b/src/Octet.hs @@ -136,15 +136,15 @@ instance Enum Octet where instance Read Octet where - readsPrec _ = \s -> + readsPrec _ s = case (reads s :: [(Int, String)]) of [] -> [] (x,leftover):_ -> go x leftover where go :: Int -> String -> [(Octet, String)] - go y s - | y < minBound || y > maxBound = [] - | otherwise = [(toEnum y, s)] + go x' leftover' + | x' < minBound || x' > maxBound = [] + | otherwise = [(toEnum x', leftover')] -- Test lists.