
1 Dec
2013
1 Dec
'13
5:30 p.m.
Prelude> import Foreign.C.Types Prelude Foreign.C.Types> read "-10" :: CUInt 4294967286 Prelude Foreign.C.Types> read "300" :: CChar 44 This seems like a bug. Shouldn't these result in some kind of read error? The values expressed as strings are simply not part of the type they are being parsed into. However, Haskell seems to parse them into an arbitrarily wide numeric type, and then overflow them down to the correct size. What's the rationale here?