Safe Haskell | None |
---|
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
pickle :: Value -> ByteStringSource
EMPTY_DICT | |
EMPTY_LIST | |
EMPTY_TUPLE | |
BINPUT Int | |
MARK | |
BININT Int | |
BININT1 Int | |
BININT2 Int | |
BINFLOAT Double | |
SHORT_BINSTRING ByteString | |
TUPLE1 | |
TUPLE2 | |
SETITEM | |
SETITEMS | |
APPEND | |
APPENDS | |
STOP |
Show OpCode | |
MonadWriter [OpCode] Pickler |
Monad Pickler | |
MonadWriter [OpCode] Pickler | |
MonadState (Map Value Int) Pickler |
runPickler :: Pickler () -> [OpCode]Source
pickleList :: [Value] -> Pickler ()Source
pickleTuple :: [Value] -> Pickler ()Source
pickleBinInt :: Int -> Pickler ()Source
pickleBinFloat :: Double -> Pickler ()Source
pickleBinString :: ByteString -> Pickler ()Source
dictGetString :: Value -> ByteString -> Either String ByteStringSource