
In prolog, one can create a database of facts and predicates, which, depending on the prolog (AFAIK) can be 'compiled' and loaded quickly. How does one do something comparable in Haskell? I guess I have in mind something like a function that accesses the data with a key. And ideally, the data should itself be able to contain functions. I know there is a hash table library, and interfaces to databases like postgresql. If using hash table, is there a way to 'pickle' the hash table, and unpickle it? I'd be happy to have some pointers to someplace that this has been done (or some documentation on how to do it. Thanks, John Velman

From the blurb: "Serialisation speeds of over 1 G/sec have been observed, so this
Hello John Data-Binary is the commonly used serialization library, it could well be adequate for your purposes: http://hackage.haskell.org/package/binary library should be suitable for high performance scenarios." It really depends how you choose to represent the database, if you have cycles serialization could be tricky, but if you just have atoms of strings for the predicates and facts it should be fine(*). Best wishes Stephen (*) Converting to and from Strings and ByteStrings will take _some_ time in the serialization layer, but it would take some time from a real database or other format.

Thanks, Stephen. Looks like this is pretty much what I'm looking for. Best, John V. On Fri, Dec 04, 2009 at 08:42:11AM +0000, Stephen Tetley wrote:
Hello John
Data-Binary is the commonly used serialization library, it could well be adequate for your purposes:
http://hackage.haskell.org/package/binary
From the blurb: "Serialisation speeds of over 1 G/sec have been observed, so this library should be suitable for high performance scenarios."
It really depends how you choose to represent the database, if you have cycles serialization could be tricky, but if you just have atoms of strings for the predicates and facts it should be fine(*).
Best wishes
Stephen
(*) Converting to and from Strings and ByteStrings will take _some_ time in the serialization layer, but it would take some time from a real database or other format.
participants (2)
-
John Velman
-
Stephen Tetley