python-pickle-0.1.0: Serialization/deserialization using Python Pickle format.

Safe HaskellNone

Language.Python.Pickle

Description

Very partial implementation of the Python Pickle Virtual Machine (protocol 2): i.e. parses pickled data into opcodes, then executes the opcodes to construct a (Haskell representation of a) Python object.

Documentation

unpickle :: ByteString -> Either String ValueSource

putFloat8 :: Double -> PutSource

data Value Source

Instances

Eq Value 
Ord Value 
Show Value 
MonadState (Map Value Int) Pickler 

unpickle' :: [OpCode] -> Either String ValueSource

execute :: [OpCode] -> Stack -> Memo -> Either String ValueSource

executeOne :: OpCode -> Stack -> Memo -> Either String (Stack, Memo)Source

executeSetitem :: Monad m => Stack -> Memo -> m ([Value], Memo)Source

executeSetitems :: Monad m => [(Value, Value)] -> Stack -> Memo -> m ([Value], Memo)Source

executeAppend :: Monad m => Stack -> Memo -> m ([Value], Memo)Source

executeAppends :: Monad m => [Value] -> Stack -> Memo -> m ([Value], Memo)Source

newtype Pickler a Source

Constructors

Pickler 

Fields

runP :: WriterT [OpCode] (State (Map Value Int)) a
 

dictGet :: Value -> Value -> Either String (Maybe Value)Source

dictGet' :: Value -> Value -> Either String ValueSource