
15 Mar
2009
15 Mar
'09
11:40 p.m.
Hi all, I have noticed that in both Data.Binary and Data.Text (which is still experimental, but still), the "decode" functions can be undefined (i.e. bottom) if they encounter malformed input. What is the preferred way to use these functions in a safe way? For example, if one writes data to a disk using Data.Binary and wants to read it back in at a later date, how can one ensure that it is valid so that Data.Binary does not hit an error? Or do you just have to catch the exception in the IO Monad? Alex