|
|
|
|
|
by millstone
2422 days ago
|
|
I think that's different. `read` requires you to know what you're deserializing up-front, while `pickle` decodes the type dynamically from the data. Dynamic languages really can have functions whose behavior cannot be expressed as some sort of type signature. |
|
Here's an example that uses Read as the serialization format and only deals with Int, Char and String; but hopefully you can imagine that I could replace the use of read with a per-type function that deserializes from a byte string or whatever.
https://repl.it/@mrgriffin/unpickle