- |if a is an instance of Read, readpText can be used as the readp method
-- the drawback is that the data inside is not inspected for common references
-- so it is recommended to create your own readp method for your complex data structures
readpText :: Read a => ST a
readpText = ST(\(Stat(c,s,v)) ->
   let us= unpack s
       l=  readsPrec 1 us
   in if Prelude.null l then Left . Error $  "not readable: " ++ us
         else let ((x,str2):_)= l
              in Right(Stat(c, pack $ Prelude.dropWhile isSpace str2,v),x) )
   <?> "readp: readsPrec "

readpText :: Read a => ST a
readpText = ST(\(Stat(c,s,v)) ->
   let us= unpack s
       l=  readsPrec 1 us
   in if Prelude.null l then Left . Error $  "not readable: " ++ us
         else let ((x,str2):_)= l
              in Right(Stat(c, pack $ Prelude.dropWhile isSpace str2,v),x) )
   <?> "readp: readsPrec "
readpText = ST(\(Stat(c,s,v)) ->
   let us= unpack s
       l=  readsPrec 1 us
   in if Prelude.null l then Left . Error $  "not readable: " ++ us
         else let ((x,str2):_)= l
              in Right(Stat(c, pack $ Prelude.dropWhile isSpace str2,v),x) )
   <?> "readp: readsPrec "