mgsloan / store

Fast binary serialization in Haskell
MIT License
109 stars 35 forks source link

Serializing functions? #137

Closed eschnett closed 5 years ago

eschnett commented 5 years ago

Is it possible to serialize functions or lambda expressions in some way?

The best way I've found so far would be to define your own Category-like type, adding a constraint that all objects in that category can be serialized. This seems tedious. Is there a better way?

mgsloan commented 5 years ago

Hi! Serializing haskell functions is outside of the scope of store. A couple possibilities come to mind:

eschnett commented 5 years ago

Thanks for the pointers.

mgsloan commented 5 years ago

Welcome! I hope dereferencing them is fruitful

eschnett commented 5 years ago

Yes, they are. I went down a rabbit hole and then emerged here: http://hackage.haskell.org/package/packman : "Any Haskell data structure apart from mutable data structures (MVars and TVars) can be serialised [...]".