-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Reading from Text and ByteString -- -- Provides a Readable type class for reading data types from ByteString -- and Text. @package readable @version 0.1.0.1 -- | The Read type class is very useful for building data types from String -- representations. But String has high overhead, so sometimes it isn't -- suitable for applications where space usage and performance are -- important. This library provides a simpler version of Read's -- functionality for Text and UTF8 encoded ByteStrings. module Data.Readable -- | ByteString and Text reading using MonadPlus to handle parse failure. -- On error, fromText and fromBS will return mzero. You can use mplus to -- provide fallback defaults. class Readable a where fromBS = fromText . decodeUtf8 fromText :: (Readable a, MonadPlus m) => Text -> m a fromBS :: (Readable a, MonadPlus m) => ByteString -> m a instance Readable Word64 instance Readable Word32 instance Readable Word16 instance Readable Word8 instance Readable Int64 instance Readable Int32 instance Readable Int16 instance Readable Int8 instance Readable Double instance Readable Float instance Readable Integer instance Readable Int instance Readable Text instance Readable ByteString