on master help sign in
drop leading spaces in 'read'
commitb68d95c891596c0f468945c8b4112c42a8e9ebf9 authorAntoine Latter <aslatter@gmail.com> dateThu 11 Aug 2011, 00:52 (15 years ago) parent9e6e6b6
1 file changed+5−3
Data/UUID/Internal.hs+5−3
Data/UUID/Internal.hs+5−3
@@ -269,9 +269,11 @@ instance Show UUID where
269269 show = toString
270270
271271instance Read UUID where
272− readsPrec _ str = case fromString (take 36 str) of
273− Nothing -> []
274− Just u -> [(u,drop 36 str)]
272+ readsPrec _ str =
273+ let noSpaces = dropWhile isSpace str
274+ in case fromString (take 36 noSpaces) of
275+ Nothing -> []
276+ Just u -> [(u,drop 36 noSpaces)]
275277
276278
277279instance Storable UUID where