module TFHOE.Raw where -- * Type 'Raw' -- | Data type on the wire. data Raw = Raw String [Raw] deriving (Show) read_safe :: Read a => String -> Either String a read_safe s = case reads s of [(x, "")] -> Right x _ -> Left $ "Read error: " ++ s