Can Haskell pretend to be a database, and if so, how?

682 Views Asked by At

I realise that this might be a silly question, but is there any way to get Haskell (or use some library with Haskell) to get it to act like an SQL database? If so, how?

Something like SQLite, but without persistence?

The idea is that I could create Haskell "tables" and Haskell "indexes" (stored in memory) and an external application could query them.

It's okay if it can't handle joins.

The reason is that an external application needs to query a database, but I'd like to keep my data in acid-state, and don't want to do the intermediate step of dumping stuff to the database all the time.

2

There are 2 best solutions below

0
On
1
On

The idea is that I could create Haskell "tables" and Haskell "indexes" (stored in memory) and an external application could query them.

Sure, no matter what programming language you use, in your application you could expose an interface (probably via sockets or the like) to construct and query data.