3 ms·
I can easily write you pickle in Haskell. In fact you can easily embed Python's single type in Haskell and thus do everything you can do in python. The differe
by choeger 7y ago
I can easily write you pickle in Haskell. In fact you can easily embed Python's single type in Haskell and thus do everything you can do in python.
The difference to Java has nothing to do with reflection, really, but rather with a uniform object representation (in Java you know the shape of all values by default).
- millstone 7y agoI don’t believe one can write pickle.load in Haskell. Please show me how! A Java pickle.load would need to lean heavily on its dynamic features including reflection. For example, looking up a class by name.
- choeger 7y agoHave a look at this typeclass, for instance: https://hackage.haskell.org/package/base-4.12.0.0/docs/Type-Reflection.html#t:TypeRep https://hackage.haskell.org/package/base-4.12.0.0/docs/Type-... If that's to complicated, just create an ADT of all the python values and translate Pickle's implementation directly.