Safe Haskell | Safe-Inferred |
---|
Documentation
class HasEndianness hasEndianness whereSource
considerEndianness :: hasEndianness -> EndiannessSource
class Serializable context a whereSource
serialize :: a -> ContextualSerialization context ()Source
deserialize :: ContextualDeserialization context aSource
type Serialization a = forall context. ContextualSerialization context aSource
type Deserialization a = forall context. ContextualDeserialization context aSource
data ContextualSerialization context a Source
MonadSerialWriter ContextualSerialization | |
MonadSerial ContextualSerialization | |
Monad (ContextualSerialization context) |
data ContextualDeserialization context a Source
MonadSerialReader ContextualDeserialization | |
MonadSerial ContextualDeserialization | |
Monad (ContextualDeserialization context) |
data SomeSerializationFailure Source
forall failure . SerializationFailure failure => SomeSerializationFailure failure |
class (Show failure, Typeable failure) => SerializationFailure failure whereSource
toSerializationFailure :: failure -> SomeSerializationFailureSource
fromSerializationFailure :: SomeSerializationFailure -> Maybe failureSource
class MonadSerial m whereSource
getContext :: forall context. Monad (m context) => m context contextSource
withContext :: forall context context' a. (Monad (m context), Monad (m context')) => context' -> m context' a -> m context aSource
getTags :: forall context. Monad (m context) => m context [(Int, String)]Source
withTag :: forall context a. Monad (m context) => String -> m context a -> m context aSource
withWindow :: forall context a. Monad (m context) => SerialOrigin -> Int -> Int -> m context a -> m context aSource
throw :: forall context failure a. (Monad (m context), SerializationFailure failure) => failure -> m context aSource
catch :: forall context failure a. (Monad (m context), SerializationFailure failure) => m context a -> (Int -> [(Int, String)] -> failure -> m context a) -> m context aSource
seek :: SerialOrigin -> Int -> m context ()Source
MonadSerial ContextualDeserialization | |
MonadSerial ContextualSerialization | |
MonadSerial (BackendSpecificDeserialization FilePath) | |
MonadSerial (BackendSpecificDeserialization ByteString) | |
MonadSerial (BackendSpecificSerialization FilePath) | |
MonadSerial (BackendSpecificSerialization ByteString) |
data SerialOrigin Source
read :: MonadSerialReader m => Int -> m context ByteStringSource
write :: MonadSerialWriter m => ByteString -> m context ()Source
runSerializationToByteString :: ContextualSerialization () a -> Either (Int, [(Int, String)], SomeSerializationFailure) (a, ByteString)Source
runSerializationToFile :: ContextualSerialization () a -> FilePath -> IO (Either (Int, [(Int, String)], SomeSerializationFailure) a)Source
runDeserializationFromByteString :: ContextualDeserialization () a -> ByteString -> Either (Int, [(Int, String)], SomeSerializationFailure) aSource
runDeserializationFromFile :: ContextualDeserialization () a -> FilePath -> IO (Either (Int, [(Int, String)], SomeSerializationFailure) a)Source
runSubDeserializationFromByteString :: ContextualDeserialization () a -> ByteString -> Deserialization aSource
toByteString :: Serializable () a => a -> Either (Int, [(Int, String)], SomeSerializationFailure) ByteStringSource
toFile :: Serializable () a => a -> FilePath -> IO (Maybe (Int, [(Int, String)], SomeSerializationFailure))Source
fromByteString :: Serializable () a => ByteString -> Either (Int, [(Int, String)], SomeSerializationFailure) aSource
fromFile :: Serializable () a => FilePath -> IO (Either (Int, [(Int, String)], SomeSerializationFailure) a)Source
serializeWord :: (Bits word, Integral word, Num word, HasEndianness context) => word -> ContextualSerialization context ()Source
deserializeWord :: forall word context. (Bits word, Integral word, Num word, HasEndianness context) => ContextualDeserialization context wordSource
serializeNullPaddedText :: Int -> ByteString -> Serialization ()Source