| Safe Haskell | None |
|---|
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
pickle :: Value -> ByteStringSource
Constructors
| 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 |
Instances
| Show OpCode | |
| MonadWriter [OpCode] Pickler |
Instances
| 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